From 38e93e930822192c9cbbf72c05a2e0cf08af436c Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 26 Dec 2017 11:49:20 -0800 Subject: [PATCH] functors2: Redo FROM: for same-functors. Execute top-level code from functors, too. --- core/functors2/functors2.factor | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/functors2/functors2.factor b/core/functors2/functors2.factor index 23fa528a1e..ddf319dd3b 100644 --- a/core/functors2/functors2.factor +++ b/core/functors2/functors2.factor @@ -89,9 +89,10 @@ ERROR: not-all-unique seq ; ] [ [ [ - dup { [ word? ] [ string? ] } 1|| [ + ! dup { [ word? ] [ string? ] } 1|| [ + dup { [ word? ] } 1|| [ [ dup word? [ vocabulary>> ] [ drop current-vocab name>> ] if ] [ dup word? [ name>> ] when ] bi - " => " glue "FROM: " " ;\n" surround drop "" + " => " glue "FROM: " " ;\n" surround ] [ drop "" ] if @@ -108,7 +109,8 @@ ERROR: not-all-unique seq ; '[ ! parse-stream forgets the previous vocab if same name @ over '[ - _ _ drop string-lines parse-lines drop + _ _ drop string-lines parse-lines + call( -- ) ! call the top-level code returned from parse-lines ] nip call ! generate-vocab use-vocab ] ] dip