From 9eecd977c95d13c1a8c2b1c746c5fb4b970fec27 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 22 Nov 2017 22:32:16 -0600 Subject: [PATCH] namespaces.extras: Try to use generate-vocab. --- extra/namespaces/extras/extras.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/namespaces/extras/extras.factor b/extra/namespaces/extras/extras.factor index 89599ee8ff..407f4cc362 100644 --- a/extra/namespaces/extras/extras.factor +++ b/extra/namespaces/extras/extras.factor @@ -4,7 +4,8 @@ USING: accessors assocs assocs.extras combinators combinators.extras continuations effects.parser formatting fry generalizations interpolate io.streams.string kernel make math.parser namespaces parser quotations sequences -sequences.generalizations unicode vocabs.parser words ; +sequences.generalizations unicode vocabs.generated vocabs.parser +words ; QUALIFIED: sets IN: namespaces.extras @@ -49,7 +50,7 @@ ERROR: not-all-unique seq ; ! make FROM: vocab => word ; for each input argument nip in>> length [ - dup '[ [ _ _ narray functor-instantiated-vocab-name "IN: " prepend ] _ nkeep ] + dup '[ [ _ _ narray functor-instantiated-vocab-name ] _ nkeep ] ] [ [ [ @@ -59,13 +60,13 @@ ERROR: not-all-unique seq ; ] replicate ] [ ] tri dup ! Make the FROM: list and keep the input arguments - '[ [ @ _ spread _ narray "\n" join "\n" glue ] _ nkeep ] + '[ [ @ _ spread _ narray "\n" join dupd [ "IN: " prepend ] dip "\n" glue ] _ nkeep ] ] [ [ drop ] 2dip ! append the IN: and the FROM: quot generator and the functor code [ append - '[ @ "functor" parse-stream drop ] + '[ @ '[ _ "functor" parse-stream drop ] generate-vocab drop ] ] dip ] 3tri ; @@ -83,6 +84,7 @@ ERROR: not-all-unique seq ; swap make-in-drop-variables prepend-input-vocabs + ! word quot effect [ [ functor-definer-word-name create-new-word-in ] 2dip define-declared