diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-07-03 07:08:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-07-03 07:08:26 -0700 |
commit | 1112aa72c98350e064f5bc11fd85a704c9270bc1 (patch) | |
tree | 0980d7a40e48430ea1e2af5640fe7ec02a7881b5 | |
parent | 9aaeb2fc604feee26a72a672fd846b4e70c6c1aa (diff) | |
download | txr-1112aa72c98350e064f5bc11fd85a704c9270bc1.tar.gz txr-1112aa72c98350e064f5bc11fd85a704c9270bc1.tar.bz2 txr-1112aa72c98350e064f5bc11fd85a704c9270bc1.zip |
Allow op arguments like @1 to be places.
* share/txr/stdlib/place.tl: Introducing new defplace
for (sys:var ...) which is treated as if it were a symbol,
in anticipation of the op/do macro placing that syntax
with a symbol.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | share/txr/stdlib/place.tl | 6 |
2 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,12 @@ +2015-07-03 Kaz Kylheku <kaz@kylheku.com> + + Allow op arguments like @1 to be places. + + * share/txr/stdlib/place.tl: Introducing new defplace + for (sys:var ...) which is treated as if it were a symbol, + in anticipation of the op/do macro placing that syntax + with a symbol. + 2015-07-02 Kaz Kylheku <kaz@kylheku.com> Support trailing semicolon after hex/octal characters. diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index 9bb39347..72e054fd 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -291,6 +291,12 @@ (tree-bind ,args (cdr ,place) ,delete-body))))))))) +(defplace (sys:var arg) body + (getter setter + ^(macrolet ((,getter () ^(sys:var ,',arg)) + (,setter (val) ^(sys:setq ,'(sys:var ,arg) ,val))) + ,body))) + (defplace (car cell) body (getter setter (with-gensyms (cell-sym) |