diff --git a/extra/lisp/lisp.factor b/extra/lisp/lisp.factor index b64957b2c5..e865a2e3ed 100644 --- a/extra/lisp/lisp.factor +++ b/extra/lisp/lisp.factor @@ -9,8 +9,8 @@ IN: lisp DEFER: convert-form DEFER: funcall DEFER: lookup-var -DEFER: lisp-macro? DEFER: lookup-macro +DEFER: lisp-macro? DEFER: macro-expand DEFER: define-lisp-macro @@ -96,10 +96,10 @@ PRIVATE> convert-form lambda-rewrite call ; inline : macro-call ( lambda -- cons ) - call ; + call ; inline : macro-expand ( cons -- quot ) - uncons lookup-macro macro-call compile-form ; + uncons [ list>seq [ ] like ] [ lookup-macro macro-call compile-form ] bi* call ; : lisp-string>factor ( str -- quot ) lisp-expr parse-result-ast compile-form ; @@ -110,10 +110,9 @@ PRIVATE> ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SYMBOL: lisp-env -ERROR: no-such-var variable-name ; - SYMBOL: macro-env +ERROR: no-such-var variable-name ; M: no-such-var summary drop "No such variable" ; : init-env ( -- ) diff --git a/extra/lists/lazy/lazy-docs.factor b/extra/lists/lazy/lazy-docs.factor index 95e925b089..6a9359027d 100644 --- a/extra/lists/lazy/lazy-docs.factor +++ b/extra/lists/lazy/lazy-docs.factor @@ -115,7 +115,7 @@ HELP: lmerge { $values { "list1" "a list" } { "list2" "a list" } { "result" "lazy list merging list1 and list2" } } { $description "Return the result of merging the two lists in a lazy manner." } { $examples - { $example "USING: lazy-lists prettyprint ;" "{ 1 2 3 } >list { 4 5 6 } >list lmerge list>array ." "{ 1 4 2 5 3 6 }" } + { $example "USING: lists.lazy prettyprint ;" "{ 1 2 3 } >list { 4 5 6 } >list lmerge list>array ." "{ 1 4 2 5 3 6 }" } } ; HELP: lcontents diff --git a/extra/lists/lists.factor b/extra/lists/lists.factor index 30a234214b..13d77f757a 100644 --- a/extra/lists/lists.factor +++ b/extra/lists/lists.factor @@ -8,7 +8,7 @@ IN: lists MIXIN: list GENERIC: car ( cons -- car ) GENERIC: cdr ( cons -- cdr ) -GENERIC: nil? ( cons -- ? ) +GENERIC: nil? ( object -- ? ) TUPLE: cons car cdr ; @@ -26,7 +26,7 @@ M: object nil? drop f ; : atom? ( obj -- ? ) [ list? ] [ nil? ] bi or not ; -: nil ( -- +nil+ ) +nil+ ; +: nil ( -- symbol ) +nil+ ; : uncons ( cons -- cdr car ) [ cdr ] [ car ] bi ; @@ -61,9 +61,9 @@ M: object nil? drop f ; : lmap ( list quot -- result ) over nil? [ drop ] [ (leach) lmap cons ] if ; inline -: foldl ( list ident quot -- result ) swapd leach ; inline +: foldl ( list identity quot -- result ) swapd leach ; inline -: foldr ( list ident quot -- result ) +: foldr ( list identity quot -- result ) pick nil? [ [ drop ] [ ] [ drop ] tri* ] [ [ [ cdr ] 2dip foldr ] [ nip [ car ] dip ] 3bi call