From e9d8ff1c0d7d1d197b5973c7bd38ed09ba34a7ba Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 8 Mar 2013 16:32:09 -0800 Subject: [PATCH] prettyprint.sections: more use of hash-sets. --- basis/prettyprint/sections/sections.factor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/basis/prettyprint/sections/sections.factor b/basis/prettyprint/sections/sections.factor index 23dc7025e4..de64eb3d59 100644 --- a/basis/prettyprint/sections/sections.factor +++ b/basis/prettyprint/sections/sections.factor @@ -5,6 +5,7 @@ namespaces make sequences strings io.styles vectors words prettyprint.config splitting classes continuations accessors sets vocabs.parser combinators vocabs classes.maybe ; +FROM: sets => members ; FROM: namespaces => set ; IN: prettyprint.sections @@ -23,7 +24,7 @@ TUPLE: pprinter last-newline line-count indent ; : (record-vocab) ( vocab -- ) dup pprinter-in get dup [ vocab-name ] when = - [ drop ] [ pprinter-use get conjoin ] if ; + [ drop ] [ pprinter-use get adjoin ] if ; GENERIC: vocabulary-name ( obj -- string ) @@ -347,7 +348,7 @@ M: block long-section ( block -- ) : pprinter-manifest ( -- manifest ) - [ [ pprinter-use get keys >vector ] dip search-vocabs<< ] + [ [ pprinter-use get members >vector ] dip search-vocabs<< ] [ [ pprinter-in get ] dip current-vocab<< ] [ ] tri ; @@ -355,7 +356,7 @@ M: block long-section ( block -- ) : make-pprint ( obj quot -- block manifest ) [ 0 position ,, - H{ } clone pprinter-use ,, + HS{ } clone pprinter-use ,, V{ } clone recursion-check ,, V{ } clone pprinter-stack ,, ] H{ } make [