core: Move more things to core.

Tricky things:
f props>> == @ _ are not defined in syntax
modern-harvey2
Doug Coleman 2017-11-24 18:42:30 -06:00
parent 085dbe716f
commit 43628c8340
232 changed files with 232 additions and 103 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2004, 2008 Slava Pestov. ! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: command-line compiler.units continuations definitions io USING: combinators command-line compiler.units continuations definitions io
io.pathnames kernel math math.parser memory namespaces parser io.pathnames kernel math math.parser memory namespaces parser
parser.notes sequences sets splitting system parser.notes sequences sets splitting system
vocabs vocabs.loader ; vocabs vocabs.loader ;
@ -75,9 +75,40 @@ CONSTANT: default-components
(command-line) parse-command-line (command-line) parse-command-line
"here0" print
{
{ [ os windows? ] [ "alien.libraries.windows" ] }
{ [ os unix? ] [ "alien.libraries.unix" ] }
} cond require
"here1" print
! { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when
! { "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when
! { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when
! { "typed" "prettyprint" } "typed.prettyprint" require-when
! { "typed" "compiler.cfg.debugger" } "typed.debugger" require-when
{ "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when
"here2" print
{ "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when { "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when
"here3" print
{ "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when
"here3.1" print
"summary" require
"here3.2" print
"eval" require
! "deques" require
! "command-line.startup" require
! "here5" print
{ "locals" "prettyprint" } "locals.prettyprint" require-when
"here6" print
{ "typed" "prettyprint" } "typed.prettyprint" require-when
"here7" print
{ "typed" "compiler.cfg.debugger" } "typed.debugger" require-when
"here8" print
"stack-checker.row-polymorphism" reload
"here9" print
! Set dll paths ! Set dll paths
os windows? [ "windows" require ] when os windows? [ "windows" require ] when

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel assocs math math.parser memoize io.encodings.utf8 USING: ascii assocs colors io.encodings.utf8 io.files kernel
io.files lexer parser colors sequences splitting ascii ; lexer math math.parser sequences splitting ;
IN: colors.constants IN: colors.constants
<PRIVATE <PRIVATE

View File

@ -2,13 +2,15 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.strings arrays assocs classes USING: accessors alien alien.strings arrays assocs classes
classes.builtin classes.mixin classes.tuple classes.tuple.parser classes.builtin classes.mixin classes.tuple classes.tuple.parser
combinators combinators.short-circuit compiler.errors compiler.units combinators combinators.short-circuit compiler.errors
continuations definitions destructors effects.parser fry generic compiler.units continuations definitions destructors
generic.math generic.parser generic.single grouping io io.encodings effects.parser fry generic generic.math generic.parser
io.styles kernel kernel.private lexer libc make math math.order generic.single grouping io io.encodings io.styles kernel
math.parser math.ratios namespaces parser prettyprint sequences kernel.private lexer libc make math math.order math.parser
sequences.private slots source-files.errors strings strings.parser math.ratios namespaces parser prettyprint sequences
summary system vocabs vocabs.loader vocabs.parser words ; sequences.private slots source-files.errors strings
strings.parser summary system vocabs vocabs.loader vocabs.parser
words ;
IN: debugger IN: debugger
GENERIC: error-help ( error -- topic ) GENERIC: error-help ( error -- topic )

View File

@ -1,8 +1,8 @@
! Copyright (C) 2008, 2009 Slava Pestov. ! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: splitting parser parser.notes compiler.units kernel USING: combinators compiler.units continuations debugger
namespaces debugger io.streams.string fry combinators effects.parser io.streams.string kernel namespaces parser
effects.parser continuations ; parser.notes splitting ;
IN: eval IN: eval
: parse-string ( str -- quot ) : parse-string ( str -- quot )

View File

@ -1,8 +1,7 @@
! Copyright (C) 2005, 2009 Slava Pestov. ! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs colors colors.constants delegate USING: accessors assocs colors delegate.protocols destructors
delegate.protocols destructors fry hashtables io hashtables io io.streams.plain io.streams.string kernel make
io.streams.plain io.streams.string kernel make math.order
namespaces present sequences splitting strings strings.tables namespaces present sequences splitting strings strings.tables
summary ; summary ;
IN: io.styles IN: io.styles

View File

@ -1,32 +0,0 @@
! Copyright (C) 2007, 2009 Slava Pestov, Eduardo Cavazos.
! See http://factorcode.org/license.txt for BSD license.
USING: fry kernel lexer locals.errors locals.parser locals.types
macros memoize namespaces sequences vocabs vocabs.loader words ;
IN: locals
SYNTAX: :>
in-lambda? get [ :>-outside-lambda-error ] unless
scan-token parse-def suffix! ;
SYNTAX: \|[ parse-lambda append! ;
SYNTAX: \let[ parse-let append! ;
SYNTAX: \'let[ H{ } clone (parse-lambda) [ fry call <let> ?rewrite-closures call ] curry append! ;
SYNTAX: \:: (::) define-declared ;
SYNTAX: \M:: (M::) define ;
SYNTAX: \MACRO:: (::) define-macro ;
SYNTAX: \MEMO:: (::) define-memoized ;
SYNTAX: \IDENTITY-MEMO:: (::) define-identity-memoized ;
{
"locals.macros"
"locals.fry"
} [ require ] each
{ "locals" "prettyprint" } "locals.definitions" require-when
{ "locals" "prettyprint" } "locals.prettyprint" require-when

View File

@ -1,7 +1,8 @@
! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos. ! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel locals locals.types prettyprint.backend USING: accessors effects kernel locals locals.definitions
prettyprint.custom prettyprint.sections sequences words ; locals.types prettyprint.backend prettyprint.custom
prettyprint.sections see sequences words ;
IN: locals.prettyprint IN: locals.prettyprint
: pprint-var ( var -- ) : pprint-var ( var -- )
@ -38,3 +39,9 @@ M: multi-def pprint*
dup locals>> [ word? ] all? dup locals>> [ word? ] all?
[ <block \ :> pprint-word "(" text locals>> [ pprint-var ] each ")" text block> ] [ <block \ :> pprint-word "(" text locals>> [ pprint-var ] each ")" text block> ]
[ pprint-tuple ] if ; [ pprint-tuple ] if ;
M: lambda-method synopsis*
dup dup dup definer.
"method-class" word-prop pprint-word
"method-generic" word-prop pprint-word
method-stack-effect effect>string comment. ;

View File

@ -98,7 +98,7 @@ deploy-libraries [ V{ } clone ] initialize
HOOK: >deployed-library-path os ( path -- path' ) HOOK: >deployed-library-path os ( path -- path' )
{ ! {
{ [ os windows? ] [ "alien.libraries.windows" ] } ! { [ os windows? ] [ "alien.libraries.windows" ] }
{ [ os unix? ] [ "alien.libraries.unix" ] } ! { [ os unix? ] [ "alien.libraries.unix" ] }
} cond require ! } cond require

View File

@ -4,7 +4,7 @@ USING: arrays assocs continuations debugger destructors generic
hash-sets hashtables hashtables.identity hashtables.wrapped init hash-sets hashtables hashtables.identity hashtables.wrapped init
io io.files kernel kernel.private make math memory namespaces io io.files kernel kernel.private make math memory namespaces
parser parser.notes prettyprint sequences splitting system parser parser.notes prettyprint sequences splitting system
vectors vocabs vocabs.loader words ; vectors vocabs vocabs.hierarchy vocabs.loader words ;
QUALIFIED: bootstrap.image.private QUALIFIED: bootstrap.image.private
IN: bootstrap.stage1 IN: bootstrap.stage1
@ -40,6 +40,15 @@ load-help? off
"syntax" require "syntax" require
"bootstrap.layouts" require "bootstrap.layouts" require
! need this
"locals" load
"alien.libraries" require
"alien.c-types" require
"delegate" require
"stack-checker" load
"generalizations" require
"combinators.short-circuit.smart" require
[ [
f parser-quiet? set-global f parser-quiet? set-global

View File

@ -90,6 +90,25 @@ IN: bootstrap.syntax
"call(" "call("
"execute(" "execute("
"IH{" "IH{"
"::"
"M::"
"MACRO:"
"MACRO::"
"TYPED:"
"TYPED::"
"MEMO:"
"MEMO::"
"MEMO["
"IDENTITY-MEMO:"
"IDENTITY-MEMO::"
"PROTOCOL:"
"CONSULT:"
"BROADCAST:"
"SLOT-PROTOCOL:"
"HINTS:"
"'["
"@"
"_"
} [ "syntax" create-word drop ] each } [ "syntax" create-word drop ] each
"t" "syntax" lookup-word define-symbol "t" "syntax" lookup-word define-symbol

View File

@ -1,7 +1,7 @@
! Copyright (C) 2011 Joe Groff. ! Copyright (C) 2011 Joe Groff.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: command-line eval io io.pathnames kernel namespaces USING: command-line eval io io.pathnames kernel namespaces
sequences system vocabs.loader ; system vocabs.loader ;
IN: command-line.startup IN: command-line.startup
: cli-usage ( -- ) : cli-usage ( -- )

View File

@ -109,13 +109,13 @@ PRIVATE>
: define-consult ( consultation -- ) : define-consult ( consultation -- )
[ register-consult ] [ consult-methods ] bi ; [ register-consult ] [ consult-methods ] bi ;
SYNTAX: \CONSULT: ! SYNTAX: \CONSULT:
scan-word scan-word parse-definition <consultation> ! scan-word scan-word parse-definition <consultation>
[ save-location ] [ define-consult ] bi ; ! [ save-location ] [ define-consult ] bi ;
SYNTAX: \BROADCAST: ! SYNTAX: \BROADCAST:
scan-word scan-word parse-definition <broadcast> ! scan-word scan-word parse-definition <broadcast>
[ save-location ] [ define-consult ] bi ; ! [ save-location ] [ define-consult ] bi ;
M: consultation where loc>> ; M: consultation where loc>> ;
@ -176,8 +176,8 @@ PRIVATE>
[ initialize-protocol-props ] 2tri [ initialize-protocol-props ] 2tri
] 2bi ; ] 2bi ;
SYNTAX: \PROTOCOL: ! SYNTAX: \PROTOCOL:
scan-new-word parse-definition define-protocol ; ! scan-new-word parse-definition define-protocol ;
PREDICATE: protocol < word protocol-words ; ! Subclass of symbol? PREDICATE: protocol < word protocol-words ; ! Subclass of symbol?
@ -190,7 +190,7 @@ M: protocol definer drop \ PROTOCOL: \ ; ;
M: protocol group-words protocol-words ; M: protocol group-words protocol-words ;
SYNTAX: \SLOT-PROTOCOL: ! SYNTAX: \SLOT-PROTOCOL:
scan-new-word ";" ! scan-new-word ";"
[ [ reader-word ] [ writer-word ] bi 2array ] ! [ [ reader-word ] [ writer-word ] bi 2array ]
map-tokens concat define-protocol ; ! map-tokens concat define-protocol ;

View File

@ -1,7 +1,6 @@
! Copyright (C) 2007 Daniel Ehrenberg ! Copyright (C) 2007 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: assocs delegate deques io sequences sequences.private USING: assocs deques io sequences sequences.private sets ;
sets ;
IN: delegate.protocols IN: delegate.protocols
PROTOCOL: sequence-protocol PROTOCOL: sequence-protocol

View File

@ -4,8 +4,8 @@ USING: accessors combinators kernel locals.backend math parser
quotations sequences sets splitting words ; quotations sequences sets splitting words ;
IN: fry IN: fry
: _ ( -- * ) "Only valid inside a fry" throw ; ! : _ ( -- * ) "Only valid inside a fry" throw ;
: @ ( -- * ) "Only valid inside a fry" throw ; ! : @ ( -- * ) "Only valid inside a fry" throw ;
ERROR: >r/r>-in-fry-error ; ERROR: >r/r>-in-fry-error ;
@ -145,4 +145,4 @@ M: callable fry ( quot -- quot' )
] bi ] bi
] if-empty ; ] if-empty ;
SYNTAX: \'[ parse-quotation fry append! ; ! SYNTAX: \'[ parse-quotation fry append! ;

View File

@ -73,11 +73,11 @@ ERROR: cannot-specialize word specializer ;
over inline-recursive? [ cannot-specialize ] when over inline-recursive? [ cannot-specialize ] when
"specializer" set-word-prop ; "specializer" set-word-prop ;
SYNTAX: \HINTS: ! SYNTAX: \HINTS:
scan-object dup wrapper? [ wrapped>> ] when ! scan-object dup wrapper? [ wrapped>> ] when
[ changed-definition ] ! [ changed-definition ]
[ subwords [ changed-definition ] each ] ! [ subwords [ changed-definition ] each ]
[ parse-definition { } like set-specializer ] tri ; ! [ parse-definition { } like set-specializer ] tri ;
! Default specializers ! Default specializers
{ pop* pop push last } [ { pop* pop push last } [

Some files were not shown because too many files have changed in this diff Show More