From fb8a30d4540d04b02f98e7895cdb02d5c7f6c2e6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 22 Jul 2015 07:42:13 -0700 Subject: * lisplib.c (place_set_entries): Add *place-macro* and define-place-macro to list of names. * share/txr/stdlib/place.tl (*place-macro*): New global hash. (sys:tigger-load, sys:pl-expand): New functions. (call-update-expander, call-clobber-expander, call-delete-expander): Recognize and expand place macros. (define-place-macro): New macro. (first, rest): Places redefined using define-place-macro, replacing the old hack of copying the expanders from one table entry to another. * txr.1: Documented place macros. --- lisplib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisplib.c') diff --git a/lisplib.c b/lisplib.c index 7fc92021..014e095b 100644 --- a/lisplib.c +++ b/lisplib.c @@ -56,7 +56,7 @@ static val place_set_entries(val dlt, val fun) { val name[] = { lit("*place-clobber-expander*"), lit("*place-update-expander*"), - lit("*place-delete-expander*"), + lit("*place-delete-expander*"), lit("*place-macro*"), lit("get-update-expander"), lit("get-clobber-expander"), lit("get-delete-expander"), lit("place-form-p"), @@ -68,7 +68,7 @@ static val place_set_entries(val dlt, val fun) lit("set"), lit("pset"), lit("zap"), lit("flip"), lit("inc"), lit("dec"), lit("push"), lit("pop"), lit("swap"), lit("shift"), lit("rotate"), lit("pushnew"), lit("del"), - lit("defplace"), lit("define-modify-macro"), + lit("defplace"), lit("define-place-macro"), lit("define-modify-macro"), lit("placelet"), lit("placelet*"), nil }; -- cgit v1.2.3