From 1112aa72c98350e064f5bc11fd85a704c9270bc1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 3 Jul 2015 07:08:26 -0700 Subject: 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. --- ChangeLog | 9 +++++++++ share/txr/stdlib/place.tl | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 998d3dab..0c2fb2df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-07-03 Kaz Kylheku + + 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 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) -- cgit v1.2.3