From e593dc1264979d99f1bad53d0496ae6f90c5e2cc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 25 Jan 2017 12:36:28 -0800 Subject: Local macrolets in build become functions. * share/txr/stdlib/build.tl (sys:list-builder-macrolets): Function renamed to sys:list-builder-flets. Builds local functions instead of macrolets. (build): Follow rename of sys:list-builder-macrolets. * txr.1: Documentation updated and example added of use of add as a higher order function. --- share/txr/stdlib/build.tl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'share') diff --git a/share/txr/stdlib/build.tl b/share/txr/stdlib/build.tl index c5fc5866..1ee166af 100644 --- a/share/txr/stdlib/build.tl +++ b/share/txr/stdlib/build.tl @@ -67,13 +67,13 @@ (:method get (self) (cdr self.head))) -(defun sys:list-builder-macrolets (lb-form) +(defun sys:list-builder-flets (lb-form) (nconc (collect-each ((op '(add add* pend pend* ncon ncon*))) - ^(,op (. forms) - ^(qref ,',lb-form (,',op ,*forms)))) + ^(,op (. args) + (qref ,lb-form (,op . args)))) ^((get () - ^(qref ,',lb-form (get)))))) + (qref ,lb-form (get)))))) (defun build-list (: init) (new list-builder head init)) @@ -81,6 +81,6 @@ (defmacro build (. forms) (with-gensyms (name) ^(let ((,name (new list-builder))) - (macrolet ,(sys:list-builder-macrolets name) + (flet ,(sys:list-builder-flets name) ,*forms (qref ,name (get)))))) -- cgit v1.2.3