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.
! 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
parser.notes sequences sets splitting system
vocabs vocabs.loader ;
@ -75,9 +75,40 @@ CONSTANT: default-components
(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
"here2" print
{ "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when
"here3" print
{ "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
os windows? [ "windows" require ] when

View File

@ -1,7 +1,7 @@
! 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 ascii ;
USING: ascii assocs colors io.encodings.utf8 io.files kernel
lexer math math.parser sequences splitting ;
IN: colors.constants
<PRIVATE

View File

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

View File

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

View File

@ -1,8 +1,7 @@
! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs colors colors.constants delegate
delegate.protocols destructors fry hashtables io
io.streams.plain io.streams.string kernel make math.order
USING: accessors assocs colors delegate.protocols destructors
hashtables io io.streams.plain io.streams.string kernel make
namespaces present sequences splitting strings strings.tables
summary ;
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.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel locals locals.types prettyprint.backend
prettyprint.custom prettyprint.sections sequences words ;
USING: accessors effects kernel locals locals.definitions
locals.types prettyprint.backend prettyprint.custom
prettyprint.sections see sequences words ;
IN: locals.prettyprint
: pprint-var ( var -- )
@ -38,3 +39,9 @@ M: multi-def pprint*
dup locals>> [ word? ] all?
[ <block \ :> pprint-word "(" text locals>> [ pprint-var ] each ")" text block> ]
[ 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' )
{
{ [ os windows? ] [ "alien.libraries.windows" ] }
{ [ os unix? ] [ "alien.libraries.unix" ] }
} cond require
! {
! { [ os windows? ] [ "alien.libraries.windows" ] }
! { [ os unix? ] [ "alien.libraries.unix" ] }
! } cond require

View File

@ -4,7 +4,7 @@ USING: arrays assocs continuations debugger destructors generic
hash-sets hashtables hashtables.identity hashtables.wrapped init
io io.files kernel kernel.private make math memory namespaces
parser parser.notes prettyprint sequences splitting system
vectors vocabs vocabs.loader words ;
vectors vocabs vocabs.hierarchy vocabs.loader words ;
QUALIFIED: bootstrap.image.private
IN: bootstrap.stage1
@ -40,6 +40,15 @@ load-help? off
"syntax" 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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,8 +4,8 @@ USING: accessors combinators kernel locals.backend math parser
quotations sequences sets splitting words ;
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 ;
@ -145,4 +145,4 @@ M: callable fry ( quot -- quot' )
] bi
] 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
"specializer" set-word-prop ;
SYNTAX: \HINTS:
scan-object dup wrapper? [ wrapped>> ] when
[ changed-definition ]
[ subwords [ changed-definition ] each ]
[ parse-definition { } like set-specializer ] tri ;
! SYNTAX: \HINTS:
! scan-object dup wrapper? [ wrapped>> ] when
! [ changed-definition ]
! [ subwords [ changed-definition ] each ]
! [ parse-definition { } like set-specializer ] tri ;
! Default specializers
{ pop* pop push last } [

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