Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Latest commit

History

240 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

A type-system and data-structures for Emacs-Lisp

Warning

The packages in this repository are experimental.

This repository contains a type-system for Emacs-Lisp and two abstractions called Struct and Trait making use of it.

Using these tools we are able to write Lisp code like the following.

(Trait:implement Rs:Publisher Rs:Processor:EmitOnTimer
(fn subscribe (self (subscriber (Trait Rs:Subscriber)))
(when self.subscriber
(error"Multiple subscriber not supported"))
(setf self.subscriber subscriber)
(self.publisher.subscribe self)))

Pleas refer to the individual packages which each have their own README.

Emil
A type-system for Emacs-Lisp.
Struct
A struct-like data-type and a trait abstraction.
Rs
A simple reactive streams implementation for demo purposes.

Installation

Using straight

(progn
(straight-register-package
'(Commons
:type git
:host github
:repo"politza/emil":files
("packages/Commons/src/*.el")))
(straight-register-package
'(Struct
:type git
:host github
:repo"politza/emil":files
("packages/Struct/src/*.el"
("Struct""packages/Struct/src/Struct/*.el")
("Struct/Support""packages/Struct/src/Struct/Support/*.el"))))
(straight-register-package
'(Transformer
:type git
:host github
:repo"politza/emil":files
("packages/Transformer/src/*.el")))
(straight-register-package
'(Emil
:type git
:host github
:repo"politza/emil":files
("packages/Emil/src/*.el"
("Emil""packages/Emil/src/Emil/*.el")
("Emil/Support""packages/Emil/src/Emil/Support/*.el"))))
(straight-register-package
'(Rs
:type git
:host github
:repo"politza/emil":files
("packages/Rs/src/*.el"
("Rs""packages/Rs/src/Rs/*.el")
("Rs/Processor""packages/Rs/src/Rs/Processor/*.el")
("Rs/Publisher""packages/Rs/src/Rs/Publisher/*.el"))))
(straight-use-package'Rs))

Configuration

There is some support for extended syntax-hightlighting and completion avaiable, which can be enabled like this:

(add-hook'emacs-lisp-mode-hook
(defunenable-emil-support ()
(when (require'Struct/Supportnilt)
(Struct:Support:syntax-mode 1)
(add-hook'completion-at-point-functions#'Emil:Support:completion-at-point-10t))
(when (require'Struct/Support/Imenunilt)
(Struct:Support:Imenu:mode 1))
(when (require'Emil/Support/Completionnilt)
(add-hook'completion-at-point-functions#'Struct:Support:completion-at-point-20t))
(require'Struct/Support/Edebugnilt)))

About

A type-system and data-structures for Emacs-Lisp

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages