summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-07-12 07:11:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-07-12 07:11:09 -0700
commitc8ae68c761a3b40ec9023e12d3efed679cca4055 (patch)
tree532a812c43249d0e1111626a9d6a0fae65155a1d
parent11e1c6cf7531d3a52955651c65cf880de3eed46c (diff)
downloadtxr-c8ae68c761a3b40ec9023e12d3efed679cca4055.tar.gz
txr-c8ae68c761a3b40ec9023e12d3efed679cca4055.tar.bz2
txr-c8ae68c761a3b40ec9023e12d3efed679cca4055.zip
* share/txr/stdlib/place.tl (place-form-p): New function.
* lisplib.c (place_set_entries): Add place-form-p to list of names.
-rw-r--r--ChangeLog6
-rw-r--r--lisplib.c1
-rw-r--r--share/txr/stdlib/place.tl5
3 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d4e45401..0a4a21d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-12 Kaz Kylheku <kaz@kylheku.com>
+
+ * share/txr/stdlib/place.tl (place-form-p): New function.
+
+ * lisplib.c (place_set_entries): Add place-form-p to list of names.
+
2015-07-11 Kaz Kylheku <kaz@kylheku.com>
Expand away sys:lisp1-value based on lexical info.
diff --git a/lisplib.c b/lisplib.c
index be437634..bc00b6a1 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -59,6 +59,7 @@ static val place_set_entries(val dlt, val fun)
lit("*place-delete-expander*"),
lit("get-update-expander"), lit("get-clobber-expander"),
lit("get-delete-expander"),
+ lit("place-form-p"),
lit("rlet"), lit("with-gensyms"),
lit("call-update-expander"), lit("call-clobber-expander"),
lit("call-delete-expander)"),
diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl
index 7bb059a8..f7e468cf 100644
--- a/share/txr/stdlib/place.tl
+++ b/share/txr/stdlib/place.tl
@@ -82,6 +82,11 @@
(makunbound ',',place-expr))))
,*op-body))
+ (defun place-form-p (place)
+ (when (or (bindable place)
+ (and (consp place) [*place-update-expander* (car place)]))
+ t))
+
(defun get-update-expander (place)
(cond
((symbolp place) (fun sys:sym-update-expander))