diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-05-15 06:35:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-05-15 06:35:29 -0700 |
commit | 63d18cb2cb30c20c9bbf00501b253bbc1cee5011 (patch) | |
tree | 30e796eb53d9de128d0d77e4cad9ca7e67b22340 /txr.1 | |
parent | 9c8a8fd762d9c199da1fe0cf9f9f8df24e8314dc (diff) | |
download | txr-63d18cb2cb30c20c9bbf00501b253bbc1cee5011.tar.gz txr-63d18cb2cb30c20c9bbf00501b253bbc1cee5011.tar.bz2 txr-63d18cb2cb30c20c9bbf00501b253bbc1cee5011.zip |
oop: new new* and lnew* macros.
* lisplib.c (struct_set_entries): Add autoload entries for
new* and lnew* symbols.
* share/txr/stdlib/struct.tl (sys:new-type, sys:new-expander):
New functions.
(new, lnew): Macros now implemented using sys:new-expander.
(new*, lnew*): New macros.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -24297,6 +24297,33 @@ initialization. Thus, during initialization, its instance slots may be freely accessed. Slots not yet initialized evaluate as .codn nil . +.coNP Macros @ new* and @ lnew* +.synb +.mets (new* >> { expr | >> ( expr << arg *)} >> { slot << init-form }*) +.mets (lnew* >> { expr | >> ( expr << arg *)} >> { slot << init-form }*) +.syne +.desc +The +.code new* +and +.code lnew* +macros are variants, respectively, of +.code new +and +.codn lnew . + +The only difference in behavior in these macros relative to +.code new +and +.code lnew +is that the +.meta name +argument is replaced with an expression +.meta expr +which is evaluated. The value of +.meta expr +must be a struct type, or a symbol which is the name of a struct type. + .coNP Macro @ with-slots .synb .mets (with-slots >> ({ slot | >> ( sym << slot )}*) < struct-expr |