]> git.eshelyaron.com Git - emacs.git/commit
Add OClosures, a cross between functions and structs
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 28 Mar 2022 14:53:14 +0000 (10:53 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 28 Mar 2022 14:53:14 +0000 (10:53 -0400)
commit52d5771e0a803f57b8cdd7675bf15f2f9b946039
tree26ff950a2c8527da7a2438d7ed1825555dbf2e40
parent3f19a23c1f60757c54a0ec7d84c625d83766ee08
Add OClosures, a cross between functions and structs

We here just add the new type.  It is not fully self-contained.
It requires cooperation from `cconv.el` on the one hand, and it
hijacks the docstring info to hold the type of OClosure objects.
This does imply that OClosures can't have docstrings, tho this
limitation will be lifted in subsequent patches.

* lisp/emacs-lisp/oclosure.el: New file.
* test/lisp/emacs-lisp/oclosure-tests.el: New file.
* doc/lispref/functions.texi (OClosures): New section.

* src/eval.c (Ffunction): Accept symbols instead of strings for docstrings.
* src/doc.c (store_function_docstring): Avoid overwriting an OClosure type.
* lisp/emacs-lisp/cconv.el (cconv--convert-function): Tweak ordering of
captured variables.
(cconv-convert): Add case for `oclosure--fix-type`.
doc/lispref/functions.texi
etc/NEWS
lisp/emacs-lisp/cconv.el
lisp/emacs-lisp/oclosure.el [new file with mode: 0644]
src/doc.c
src/eval.c
test/lisp/emacs-lisp/oclosure-tests.el [new file with mode: 0644]