Merge branch 'master' of http://dharmatech.onigirihouse.com/factor
commit
ca6e873b08
|
@ -348,9 +348,8 @@ SYMBOL: bootstrap-syntax
|
||||||
call
|
call
|
||||||
] with-scope ; inline
|
] with-scope ; inline
|
||||||
|
|
||||||
: with-interactive-vocabs ( quot -- )
|
SYMBOL: interactive-vocabs
|
||||||
[
|
|
||||||
"scratchpad" in set
|
|
||||||
{
|
{
|
||||||
"arrays"
|
"arrays"
|
||||||
"assocs"
|
"assocs"
|
||||||
|
@ -386,7 +385,12 @@ SYMBOL: bootstrap-syntax
|
||||||
"vocabs.loader"
|
"vocabs.loader"
|
||||||
"words"
|
"words"
|
||||||
"scratchpad"
|
"scratchpad"
|
||||||
} set-use
|
} interactive-vocabs set-global
|
||||||
|
|
||||||
|
: with-interactive-vocabs ( quot -- )
|
||||||
|
[
|
||||||
|
"scratchpad" in set
|
||||||
|
interactive-vocabs get set-use
|
||||||
call
|
call
|
||||||
] with-scope ; inline
|
] with-scope ; inline
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel io io.files splitting strings
|
USING: kernel io io.files splitting strings
|
||||||
hashtables sequences assocs math namespaces prettyprint
|
hashtables sequences assocs math namespaces prettyprint
|
||||||
math.parser combinators arrays sorting ;
|
math.parser combinators arrays sorting unicode.case ;
|
||||||
|
|
||||||
IN: benchmark.knucleotide
|
IN: benchmark.knucleotide
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: io io.files io.streams.duplex kernel sequences
|
USING: io io.files io.streams.duplex kernel sequences
|
||||||
sequences.private strings vectors words memoize splitting
|
sequences.private strings vectors words memoize splitting
|
||||||
hints ;
|
hints unicode.case ;
|
||||||
IN: benchmark.reverse-complement
|
IN: benchmark.reverse-complement
|
||||||
|
|
||||||
MEMO: trans-map ( -- str )
|
MEMO: trans-map ( -- str )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
USING: kernel io io.files io.launcher
|
USING: kernel io io.files io.launcher tools.deploy.backend
|
||||||
system namespaces sequences splitting math.parser
|
system namespaces sequences splitting math.parser
|
||||||
unix prettyprint tools.time calendar bake vars ;
|
unix prettyprint tools.time calendar bake vars ;
|
||||||
|
|
||||||
|
@ -31,8 +31,6 @@ SYMBOL: builder-recipients
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: boot-image ( -- filename ) `{ "boot" ,[ cpu ] "image" } "." join ;
|
|
||||||
|
|
||||||
: target ( -- target ) `{ ,[ os ] %[ cpu "." split ] } "-" join ;
|
: target ( -- target ) `{ ,[ os ] %[ cpu "." split ] } "-" join ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
@ -61,7 +59,7 @@ if
|
||||||
|
|
||||||
"factor" cd
|
"factor" cd
|
||||||
|
|
||||||
{ "/usr/bin/git" "show" } <process-stream>
|
{ "git" "show" } <process-stream>
|
||||||
[ readln ] with-stream
|
[ readln ] with-stream
|
||||||
" " split second
|
" " split second
|
||||||
"../git-id" <file-writer> [ print ] with-stream
|
"../git-id" <file-writer> [ print ] with-stream
|
||||||
|
@ -76,7 +74,7 @@ if
|
||||||
"builder: vm compile" throw
|
"builder: vm compile" throw
|
||||||
] if
|
] if
|
||||||
|
|
||||||
"wget http://factorcode.org/images/latest/" boot-image append system
|
"wget http://factorcode.org/images/latest/" boot-image-name append system
|
||||||
0 =
|
0 =
|
||||||
[ ]
|
[ ]
|
||||||
[
|
[
|
||||||
|
@ -84,7 +82,11 @@ if
|
||||||
"builder: image download" throw
|
"builder: image download" throw
|
||||||
] if
|
] if
|
||||||
|
|
||||||
[ "./factor -i=" boot-image " -no-user-init > ../boot-log" 3append system ]
|
[
|
||||||
|
"./factor -i=" boot-image-name " -no-user-init > ../boot-log"
|
||||||
|
3append
|
||||||
|
system
|
||||||
|
]
|
||||||
benchmark nip
|
benchmark nip
|
||||||
"../boot-time" <file-writer> [ . ] with-stream
|
"../boot-time" <file-writer> [ . ] with-stream
|
||||||
0 =
|
0 =
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
! Adapted from cryptlib.h
|
! Adapted from cryptlib.h
|
||||||
! Tested with cryptlib 3.3.1.0
|
! Tested with cryptlib 3.3.1.0
|
||||||
USING: cryptlib.libcl kernel hashtables alien math
|
USING: cryptlib.libcl kernel hashtables alien math
|
||||||
namespaces sequences assocs libc alien.c-types continuations ;
|
namespaces sequences assocs libc alien.c-types alien.accessors continuations ;
|
||||||
|
|
||||||
IN: cryptlib
|
IN: cryptlib
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel peg strings promises sequences math math.parser
|
USING: kernel peg strings promises sequences math math.parser
|
||||||
namespaces words quotations arrays hashtables io
|
namespaces words quotations arrays hashtables io
|
||||||
io.streams.string assocs memoize ;
|
io.streams.string assocs memoize ascii ;
|
||||||
IN: fjsc
|
IN: fjsc
|
||||||
|
|
||||||
TUPLE: ast-number value ;
|
TUPLE: ast-number value ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007 Slava Pestov.
|
! Copyright (C) 2007 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: parser-combinators regexp lazy-lists sequences kernel
|
USING: parser-combinators regexp lazy-lists sequences kernel
|
||||||
promises strings ;
|
promises strings unicode.case ;
|
||||||
IN: globs
|
IN: globs
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: arrays combinators.lib io io.streams.string
|
USING: arrays combinators.lib io io.streams.string
|
||||||
kernel math math.parser namespaces prettyprint
|
kernel math math.parser namespaces prettyprint
|
||||||
sequences splitting strings ;
|
sequences splitting strings ascii ;
|
||||||
IN: hexdump
|
IN: hexdump
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
USING: arrays combinators io io.binary io.files io.paths
|
USING: arrays combinators io io.binary io.files io.paths
|
||||||
io.utf16 kernel math math.parser namespaces sequences
|
io.utf16 kernel math math.parser namespaces sequences
|
||||||
splitting strings assocs ;
|
splitting strings assocs unicode.categories ;
|
||||||
|
|
||||||
IN: id3
|
IN: id3
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007 Doug Coleman, Slava Pestov.
|
! Copyright (C) 2007 Doug Coleman, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays calendar io io.sockets kernel match namespaces
|
USING: arrays calendar io io.sockets kernel match namespaces
|
||||||
sequences splitting strings continuations threads ;
|
sequences splitting strings continuations threads ascii ;
|
||||||
IN: irc
|
IN: irc
|
||||||
|
|
||||||
! "setup" objects
|
! "setup" objects
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel parser-combinators namespaces sequences promises strings
|
USING: kernel parser-combinators namespaces sequences promises strings
|
||||||
assocs math math.parser math.vectors math.functions
|
assocs math math.parser math.vectors math.functions
|
||||||
lazy-lists hashtables ;
|
lazy-lists hashtables ascii ;
|
||||||
IN: json.reader
|
IN: json.reader
|
||||||
|
|
||||||
! Grammar for JSON from RFC 4627
|
! Grammar for JSON from RFC 4627
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
! Copyright (C) 2007 Doug Coleman.
|
! Copyright (C) 2007 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien arrays assocs combinators.lib io kernel
|
USING: alien alien.accessors arrays assocs combinators.lib io kernel
|
||||||
macros math namespaces prettyprint quotations sequences
|
macros math namespaces prettyprint quotations sequences
|
||||||
vectors vocabs words ;
|
vectors vocabs words html.elements slots.private tar ;
|
||||||
USING: html.elements slots.private tar ;
|
|
||||||
IN: lint
|
IN: lint
|
||||||
|
|
||||||
SYMBOL: def-hash
|
SYMBOL: def-hash
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2006 Chris Double.
|
! Copyright (C) 2006 Chris Double.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel strings math sequences lazy-lists words
|
USING: kernel strings math sequences lazy-lists words
|
||||||
math.parser promises parser-combinators ;
|
math.parser promises parser-combinators unicode.categories ;
|
||||||
IN: parser-combinators.simple
|
IN: parser-combinators.simple
|
||||||
|
|
||||||
: 'digit' ( -- parser )
|
: 'digit' ( -- parser )
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2007 Chris Double.
|
! Copyright (C) 2007 Chris Double.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel parser words arrays strings math.parser sequences
|
USING: kernel parser words arrays strings math.parser sequences
|
||||||
quotations vectors namespaces math assocs continuations peg ;
|
quotations vectors namespaces math assocs continuations peg
|
||||||
|
unicode.categories ;
|
||||||
IN: peg.ebnf
|
IN: peg.ebnf
|
||||||
|
|
||||||
TUPLE: ebnf-non-terminal symbol ;
|
TUPLE: ebnf-non-terminal symbol ;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2007 Chris Double.
|
! Copyright (C) 2007 Chris Double.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel sequences strings namespaces math assocs shuffle
|
USING: kernel sequences strings namespaces math assocs shuffle
|
||||||
vectors arrays combinators.lib memoize math.parser match ;
|
vectors arrays combinators.lib memoize math.parser match
|
||||||
|
unicode.categories ;
|
||||||
IN: peg
|
IN: peg
|
||||||
|
|
||||||
TUPLE: parse-result remaining ast ;
|
TUPLE: parse-result remaining ast ;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
! Copyright (c) 2007 Aaron Schaefer.
|
! Copyright (c) 2007 Aaron Schaefer.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: combinators.lib kernel math.ranges math.text.english sequences strings ;
|
USING: combinators.lib kernel math.ranges math.text.english sequences strings
|
||||||
|
ascii ;
|
||||||
IN: project-euler.017
|
IN: project-euler.017
|
||||||
|
|
||||||
! http://projecteuler.net/index.php?section=problems&id=17
|
! http://projecteuler.net/index.php?section=problems&id=17
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (c) 2007 Aaron Schaefer.
|
! Copyright (c) 2007 Aaron Schaefer.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io.files kernel math math.parser namespaces sequences sorting splitting
|
USING: io.files kernel math math.parser namespaces sequences sorting splitting
|
||||||
strings system vocabs ;
|
strings system vocabs ascii ;
|
||||||
IN: project-euler.022
|
IN: project-euler.022
|
||||||
|
|
||||||
! http://projecteuler.net/index.php?section=problems&id=22
|
! http://projecteuler.net/index.php?section=problems&id=22
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: kernel sequences arrays vectors namespaces math strings
|
USING: kernel sequences arrays vectors namespaces math strings
|
||||||
combinators continuations quotations io assocs ;
|
combinators continuations quotations io assocs ascii ;
|
||||||
|
|
||||||
IN: prolog
|
IN: prolog
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: arrays combinators kernel lazy-lists math math.parser
|
USING: arrays combinators kernel lazy-lists math math.parser
|
||||||
namespaces parser parser-combinators parser-combinators.simple
|
namespaces parser parser-combinators parser-combinators.simple
|
||||||
promises quotations sequences combinators.lib strings
|
promises quotations sequences combinators.lib strings
|
||||||
assocs prettyprint.backend memoize ;
|
assocs prettyprint.backend memoize unicode.case unicode.categories ;
|
||||||
USE: io
|
USE: io
|
||||||
IN: regexp
|
IN: regexp
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: arrays assocs kernel math math.vectors namespaces
|
USING: arrays assocs kernel math math.vectors namespaces
|
||||||
quotations sequences sequences.lib sequences.private strings ;
|
quotations sequences sequences.lib sequences.private strings unicode.case ;
|
||||||
IN: roman
|
IN: roman
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2006 Daniel Ehrenberg
|
! Copyright (C) 2006 Daniel Ehrenberg
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel math sequences strings io combinators ;
|
USING: kernel math sequences strings io combinators ascii ;
|
||||||
IN: rot13
|
IN: rot13
|
||||||
|
|
||||||
: rotate ( ch base -- ch ) tuck - 13 + 26 mod + ;
|
: rotate ( ch base -- ch ) tuck - 13 + 26 mod + ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: combinators.lib kernel sequences math namespaces assocs
|
USING: combinators.lib kernel sequences math namespaces assocs
|
||||||
random sequences.private shuffle math.functions mirrors ;
|
random sequences.private shuffle math.functions mirrors
|
||||||
USING: arrays math.parser sorting strings ;
|
arrays math.parser sorting strings ascii ;
|
||||||
IN: sequences.lib
|
IN: sequences.lib
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2005, 2006 Daniel Ehrenberg
|
! Copyright (C) 2005, 2006 Daniel Ehrenberg
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io io.streams.string kernel math namespaces sequences
|
USING: io io.streams.string kernel math namespaces sequences
|
||||||
strings circular prettyprint debugger ;
|
strings circular prettyprint debugger unicode.categories ;
|
||||||
IN: state-parser
|
IN: state-parser
|
||||||
|
|
||||||
! * Basic underlying words
|
! * Basic underlying words
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
USING: math arrays sequences kernel splitting strings ;
|
USING: math arrays sequences kernel splitting strings ;
|
||||||
IN: strings.lib
|
IN: strings.lib
|
||||||
|
|
||||||
: char>digit ( c -- i ) 48 - ;
|
! : char>digit ( c -- i ) 48 - ;
|
||||||
|
|
||||||
: string>digits ( s -- seq ) [ char>digit ] { } map-as ;
|
! : string>digits ( s -- seq ) [ char>digit ] { } map-as ;
|
||||||
|
|
||||||
: >Upper ( str -- str )
|
! : >Upper ( str -- str )
|
||||||
dup empty? [
|
! dup empty? [
|
||||||
unclip ch>upper 1string swap append
|
! unclip ch>upper 1string swap append
|
||||||
] unless ;
|
! ] unless ;
|
||||||
|
|
||||||
: >Upper-dashes ( str -- str )
|
! : >Upper-dashes ( str -- str )
|
||||||
"-" split [ >Upper ] map "-" join ;
|
! "-" split [ >Upper ] map "-" join ;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: xml.errors xml.data xml.utilities xml.char-classes
|
USING: xml.errors xml.data xml.utilities xml.char-classes
|
||||||
xml.entities kernel state-parser kernel namespaces strings math
|
xml.entities kernel state-parser kernel namespaces strings math
|
||||||
math.parser sequences assocs arrays splitting combinators ;
|
math.parser sequences assocs arrays splitting combinators unicode.case ;
|
||||||
IN: xml.tokenize
|
IN: xml.tokenize
|
||||||
|
|
||||||
! XML namespace processing: ns = namespace
|
! XML namespace processing: ns = namespace
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: io io.streams.string io.files kernel math namespaces
|
USING: io io.streams.string io.files kernel math namespaces
|
||||||
prettyprint sequences arrays generic strings vectors
|
prettyprint sequences arrays generic strings vectors
|
||||||
xml.char-classes xml.data xml.errors xml.tokenize xml.writer
|
xml.char-classes xml.data xml.errors xml.tokenize xml.writer
|
||||||
xml.utilities state-parser assocs ;
|
xml.utilities state-parser assocs unicode.categories ;
|
||||||
IN: xml
|
IN: xml
|
||||||
|
|
||||||
! -- Overall parser with data tree
|
! -- Overall parser with data tree
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
USING: kernel strings assocs sequences hashtables sorting ;
|
USING: kernel strings assocs sequences hashtables sorting
|
||||||
|
unicode.case unicode.categories ;
|
||||||
IN: xmode.keyword-map
|
IN: xmode.keyword-map
|
||||||
|
|
||||||
! Based on org.gjt.sp.jedit.syntax.KeywordMap
|
! Based on org.gjt.sp.jedit.syntax.KeywordMap
|
||||||
|
|
|
@ -2,7 +2,7 @@ IN: xmode.marker
|
||||||
USING: kernel namespaces xmode.rules xmode.tokens
|
USING: kernel namespaces xmode.rules xmode.tokens
|
||||||
xmode.marker.state xmode.marker.context xmode.utilities
|
xmode.marker.state xmode.marker.context xmode.utilities
|
||||||
xmode.catalog sequences math assocs combinators combinators.lib
|
xmode.catalog sequences math assocs combinators combinators.lib
|
||||||
strings regexp splitting parser-combinators ;
|
strings regexp splitting parser-combinators ascii unicode.case ;
|
||||||
|
|
||||||
! Based on org.gjt.sp.jedit.syntax.TokenMarker
|
! Based on org.gjt.sp.jedit.syntax.TokenMarker
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: xmode.tokens xmode.keyword-map kernel
|
USING: xmode.tokens xmode.keyword-map kernel
|
||||||
sequences vectors assocs strings memoize regexp ;
|
sequences vectors assocs strings memoize regexp unicode.case ;
|
||||||
IN: xmode.rules
|
IN: xmode.rules
|
||||||
|
|
||||||
TUPLE: string-matcher string ignore-case? ;
|
TUPLE: string-matcher string ignore-case? ;
|
||||||
|
|
Loading…
Reference in New Issue