[ T{ color f 1 2 3 } ]
[ 1 2 3 [ color boa ] compile-call ] unit-test
-[ 1 3 ] [
- 1 2 3 color boa
- [ { color-red color-blue } get-slots ] compile-call
-] unit-test
-
[ T{ color f f f f } ]
[ [ color new ] compile-call ] unit-test
-USING: words quotations kernel effects sequences parser ;\r
+! Copyright (C) 2008 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: accessors words quotations kernel effects sequences parser ;\r
IN: alias\r
\r
PREDICATE: alias < word "alias" word-prop ;\r
! Copyright (C) 2007 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel macros sequences slots words mirrors ;
+USING: kernel macros sequences slots words classes.tuple ;
IN: classes.tuple.lib
: reader-slots ( seq -- quot )
! Copyright (C) 2006 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING: kernel math sequences words arrays io io.files namespaces
-math.parser assocs quotations parser lexer parser-combinators
-tools.time io.encodings.binary sequences.deep symbols combinators ;
+USING: accessors kernel math sequences words arrays io io.files
+namespaces math.parser assocs quotations parser lexer
+parser-combinators tools.time io.encodings.binary sequences.deep
+symbols combinators ;
IN: cpu.8080.emulator
TUPLE: cpu b c d e f h l a pc sp halted? last-interrupt cycles ram ;
! Copyright (C) 2006 Chris Double. All Rights Reserved.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel peg strings promises sequences math math.parser
- namespaces words quotations arrays hashtables io
- io.streams.string assocs memoize ascii peg.parsers ;
+USING: accessors kernel peg strings promises sequences math
+math.parser namespaces words quotations arrays hashtables io
+io.streams.string assocs memoize ascii peg.parsers ;
IN: fjsc
TUPLE: ast-number value ;
] { } make <ast-hashtable> ;
M: wrapper (parse-factor-quotation) ( object -- ast )
- wrapped dup name>> swap vocabulary>> <ast-word> ;
+ wrapped>> dup name>> swap vocabulary>> <ast-word> ;
GENERIC: fjsc-parse ( object -- ast )
-USING: kernel words inspector slots quotations sequences assocs
-math arrays inference effects shuffle continuations debugger
-classes.tuple namespaces vectors bit-arrays byte-arrays strings
-sbufs math.functions macros sequences.private combinators
-mirrors combinators.lib combinators.short-circuit ;
+! Copyright (C) 2007, 2008 Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel words inspector slots quotations
+sequences assocs math arrays inference effects shuffle
+continuations debugger classes.tuple namespaces vectors
+bit-arrays byte-arrays strings sbufs math.functions macros
+sequences.private combinators mirrors combinators.lib
+combinators.short-circuit ;
IN: inverse
TUPLE: fail ;
[ ] like [ drop ] compose ;
: ?wrapped ( object -- wrapped )
- dup wrapper? [ wrapped ] when ;
+ dup wrapper? [ wrapped>> ] when ;
: boa-inverse ( class -- quot )
[ deconstruct-pred ] keep slot-readers compose ;
! Copyright (C) 2006, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays assocs hashtables assocs io kernel math
+USING: accessors arrays assocs hashtables assocs io kernel math
math.vectors math.matrices math.matrices.elimination namespaces
parser prettyprint sequences words combinators math.parser
splitting sorting shuffle symbols sets math.order ;
: <method> ( specializer generic -- word )
[ method-word-props ] 2keep
method-word-name f <word>
- [ set-word-props ] keep ;
+ swap >>props ;
: with-methods ( word quot -- )
over >r >r "multi-methods" word-prop
! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien alien.strings alien.syntax combinators
-alien.c-types strings sequences namespaces words math threads
-io.encodings.ascii ;
+USING: accessors kernel alien alien.strings alien.syntax
+combinators alien.c-types strings sequences namespaces words
+math threads io.encodings.ascii ;
IN: odbc
<< "odbc" "odbc32.dll" "stdcall" add-library >>
+++ /dev/null
-USING: assocs words sequences arrays compiler tools.time\r
-io.styles io prettyprint vocabs kernel sorting generator\r
-optimizer math math.order ;\r
-IN: optimizer.report\r
-\r
-: count-optimization-passes ( nodes n -- n )\r
- >r optimize-1\r
- [ r> 1+ count-optimization-passes ] [ drop r> ] if ;\r
-\r
-: results ( seq -- )\r
- [ [ second ] prepose compare ] curry sort 20 tail*\r
- print\r
- standard-table-style\r
- [\r
- [ [ [ pprint-cell ] each ] with-row ] each\r
- ] tabular-output ;\r
-\r
-: optimizer-report ( -- )\r
- all-words [ compiled>> ] filter\r
- [\r
- dup [\r
- word-dataflow nip 1 count-optimization-passes\r
- ] benchmark 2array\r
- ] { } map>assoc\r
- [ first ] "Worst number of optimizer passes:" results\r
- [ second ] "Worst compile times:" results ;\r
-\r
-MAIN: optimizer-report\r
-USING: assocs math kernel shuffle combinators.lib\r
+USING: accessors assocs math kernel shuffle combinators.lib\r
words quotations arrays combinators sequences math.vectors\r
io.styles prettyprint vocabs sorting io generic locals.private\r
math.statistics math.order ;\r
\r
M: word noise badness 1 2array ;\r
\r
-M: wrapper noise wrapped noise ;\r
+M: wrapper noise wrapped>> noise ;\r
\r
M: let noise let-body noise ;\r
\r
-USING: assocs words sequences arrays compiler tools.time\r
-io.styles io prettyprint vocabs kernel sorting generator\r
-optimizer math math.order ;\r
+! Copyright (C) 2008 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: accessors assocs words sequences arrays compiler\r
+tools.time io.styles io prettyprint vocabs kernel sorting\r
+generator optimizer math math.order ;\r
IN: report.optimizer\r
\r
: count-optimization-passes ( nodes n -- n )\r
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: qualified io.streams.c init fry namespaces assocs kernel
-parser lexer strings.parser tools.deploy.config vocabs sequences
-words words.private memory kernel.private continuations io
-prettyprint vocabs.loader debugger system strings sets ;
+USING: accessors qualified io.streams.c init fry namespaces
+assocs kernel parser lexer strings.parser tools.deploy.config
+vocabs sequences words words.private memory kernel.private
+continuations io prettyprint vocabs.loader debugger system
+strings sets ;
QUALIFIED: bootstrap.stage2
QUALIFIED: classes
QUALIFIED: command-line
: strip-word-names ( words -- )
"Stripping word names" show
- [ f over set-word-name f swap set-vocabulary>> ] each ;
+ [ f >>name f >>vocabulary drop ] each ;
: strip-word-defs ( words -- )
"Stripping symbolic word definitions" show
[ "no-def-strip" word-prop not ] filter
- [ [ ] swap set-word-def ] each ;
+ [ [ ] >>def drop ] each ;
: strip-word-props ( stripped-props words -- )
"Stripping word properties" show
props>> swap
'[ drop , member? not ] assoc-filter
f assoc-like
- ] keep set-word-props
+ ] keep (>>props)
] with each ;
: stripped-word-props ( -- seq )
! Thanks to Mackenzie Straight for the idea
-USING: kernel parser lexer words namespaces sequences quotations ;
+USING: accessors kernel parser lexer words namespaces sequences quotations ;
IN: vars
-USING: xmode.tokens xmode.keyword-map kernel
+USING: accessors xmode.tokens xmode.keyword-map kernel
sequences vectors assocs strings memoize regexp unicode.case ;
IN: xmode.rules