diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:43:00 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-30 07:43:00 -0800 |
commit | e8f6f8d3aa516b4154dd9832bf50de82ddb07840 (patch) | |
tree | 774fac61fad3f04968fb7f404a32ba27150e803f /txr.1 | |
parent | a35352076ebdadf1a522e0e80ffaef83c91ef1e1 (diff) | |
download | txr-e8f6f8d3aa516b4154dd9832bf50de82ddb07840.tar.gz txr-e8f6f8d3aa516b4154dd9832bf50de82ddb07840.tar.bz2 txr-e8f6f8d3aa516b4154dd9832bf50de82ddb07840.zip |
defun can define methods.
* eval.c (op_defun): Handle (meth type name) syntax
in place of name via sys:defmeth function, which
is dynamically resolved and autoloaded as necessary.
(builtin_reject_test): When defun is being checked,
recognize a (method ...) form and allow it.
* struct.h (meth_s): Declaration added.
* txr.1: Documented new defun capability.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -10932,6 +10932,30 @@ and .code nil may not be used as function names. Neither can keyword symbols. +It is possible to define methods with +.codn defun , +as an alternative to the +.code defmeth +macro. + +To define a method, the syntax +.cblk +.meti (meth < type << name ) +.cble +should be used as the argument to the +.meta name +parameter. + +The syntax +.cblk +.meti (defun (meth type name) args forms) +.cble +is equivalent to the +.cblk +.meti (defmeth type name args forms) +.cble +syntax. + .TP* "Dialect Note:" In ANSI Common Lisp, keywords may be used as function names. In TXR Lisp, they may not. |