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.
(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))
There is some support for extended syntax-hightlighting and completion avaiable, which can be enabled like this:
(add-hook 'emacs-lisp-mode-hook
(defun enable-emil-support ()
(when (require 'Struct/Support nil t)
(Struct:Support:syntax-mode 1)
(add-hook 'completion-at-point-functions #'Emil:Support:completion-at-point -10 t))
(when (require 'Struct/Support/Imenu nil t)
(Struct:Support:Imenu:mode 1))
(when (require 'Emil/Support/Completion nil t)
(add-hook 'completion-at-point-functions #'Struct:Support:completion-at-point -20 t))
(require 'Struct/Support/Edebug nil t)))