Fix some annoying circularity; prettyprinter cannot depend on any vocab that depends on locals or stack-checker

db4
Slava Pestov 2009-09-08 15:15:36 -05:00
parent d596e3abe7
commit 33bfb95614
2 changed files with 21 additions and 23 deletions

View File

@ -1,17 +1,15 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel assocs math math.parser memoize io.encodings.utf8
io.files lexer parser colors sequences splitting
combinators.smart ascii ;
io.files lexer parser colors sequences splitting ascii ;
IN: colors.constants
<PRIVATE
: parse-color ( line -- name color )
[
first4
[ [ string>number 255 /f ] tri@ 1.0 <rgba> ] dip
[ blank? ] trim-head { { CHAR: \s CHAR: - } } substitute swap
] input<sequence ;
[ blank? ] trim-head { { CHAR: \s CHAR: - } } substitute swap ;
: parse-rgb.txt ( lines -- assoc )
[ "!" head? not ] filter

View File

@ -1,15 +1,15 @@
USING: kernel combinators quotations arrays sequences assocs
locals generalizations macros fry ;
generalizations macros fry ;
IN: combinators.short-circuit
MACRO:: n&& ( quots n -- quot )
[ f ] quots [| q |
n
[ q '[ drop _ ndup @ dup not ] ]
[ '[ drop _ ndrop f ] ]
bi 2array
] map
n '[ _ nnip ] suffix 1array
MACRO: n&& ( quots n -- quot )
[
[ [ f ] ] 2dip swap [
[ '[ drop _ ndup @ dup not ] ]
[ drop '[ drop _ ndrop f ] ]
2bi 2array
] with map
] [ '[ _ nnip ] suffix 1array ] bi
[ cond ] 3append ;
<PRIVATE
@ -24,14 +24,14 @@ PRIVATE>
: 2&& ( obj1 obj2 quots -- ? ) [ with with ] unoptimized-&& ;
: 3&& ( obj1 obj2 obj3 quots -- ? ) [ with with with ] unoptimized-&& ;
MACRO:: n|| ( quots n -- quot )
[ f ] quots [| q |
n
[ q '[ drop _ ndup @ dup ] ]
[ '[ _ nnip ] ]
bi 2array
] map
n '[ drop _ ndrop t ] [ f ] 2array suffix 1array
MACRO: n|| ( quots n -- quot )
[
[ [ f ] ] 2dip swap [
[ '[ drop _ ndup @ dup ] ]
[ drop '[ _ nnip ] ]
2bi 2array
] with map
] [ '[ drop _ ndrop t ] [ f ] 2array suffix 1array ] bi
[ cond ] 3append ;
<PRIVATE