Move (execute) to kernel.private

db4
Slava Pestov 2009-04-26 02:42:37 -05:00
parent 89eccddde7
commit 7e84daf0f1
13 changed files with 33 additions and 35 deletions

View File

@ -5,7 +5,7 @@ hashtables.private io io.binary io.files io.encodings.binary
io.pathnames kernel kernel.private math namespaces make parser io.pathnames kernel kernel.private math namespaces make parser
prettyprint sequences sequences.private strings sbufs vectors words prettyprint sequences sequences.private strings sbufs vectors words
quotations assocs system layouts splitting grouping growable classes quotations assocs system layouts splitting grouping growable classes
classes.builtin classes.tuple classes.tuple.private words.private classes.builtin classes.tuple classes.tuple.private
vocabs vocabs.loader source-files definitions debugger vocabs vocabs.loader source-files definitions debugger
quotations.private sequences.private combinators math.order quotations.private sequences.private combinators math.order
math.private accessors slots.private compiler.units compiler.constants math.private accessors slots.private compiler.units compiler.constants

View File

@ -3,7 +3,7 @@
USING: arrays byte-arrays byte-vectors generic assocs hashtables USING: arrays byte-arrays byte-vectors generic assocs hashtables
io.binary kernel kernel.private math namespaces make sequences io.binary kernel kernel.private math namespaces make sequences
words quotations strings alien.accessors alien.strings layouts words quotations strings alien.accessors alien.strings layouts
system combinators math.bitwise words.private math.order system combinators math.bitwise math.order
accessors growable cpu.architecture compiler.constants ; accessors growable cpu.architecture compiler.constants ;
IN: compiler.codegen.fixup IN: compiler.codegen.fixup

View File

@ -1,7 +1,7 @@
USING: assocs compiler.cfg.builder compiler.cfg.optimizer USING: assocs compiler.cfg.builder compiler.cfg.optimizer
compiler.errors compiler.tree.builder compiler.tree.optimizer compiler.errors compiler.tree.builder compiler.tree.optimizer
compiler.units help.markup help.syntax io parser quotations compiler.units help.markup help.syntax io parser quotations
sequences words words.private ; sequences words ;
IN: compiler IN: compiler
HELP: enable-compiler HELP: enable-compiler

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: bootstrap.image.private kernel kernel.private namespaces USING: bootstrap.image.private kernel kernel.private namespaces
system cpu.ppc.assembler compiler.codegen.fixup compiler.units system cpu.ppc.assembler compiler.codegen.fixup compiler.units
compiler.constants math math.private layouts words words.private compiler.constants math math.private layouts words
vocabs slots.private locals.backend ; vocabs slots.private locals.backend ;
IN: bootstrap.ppc IN: bootstrap.ppc

View File

@ -3,7 +3,7 @@
USING: bootstrap.image.private kernel kernel.private namespaces USING: bootstrap.image.private kernel kernel.private namespaces
system cpu.x86.assembler layouts compiler.units math system cpu.x86.assembler layouts compiler.units math
math.private compiler.constants vocabs slots.private words math.private compiler.constants vocabs slots.private words
words.private locals.backend ; locals.backend ;
IN: bootstrap.x86 IN: bootstrap.x86
big-endian off big-endian off

View File

@ -9,8 +9,8 @@ quotations quotations.private sbufs sbufs.private
sequences sequences.private slots.private strings sequences sequences.private slots.private strings
strings.private system threads.private classes.tuple strings.private system threads.private classes.tuple
classes.tuple.private vectors vectors.private words definitions classes.tuple.private vectors vectors.private words definitions
words.private assocs summary compiler.units system.private assocs summary compiler.units system.private
combinators locals locals.backend locals.types words.private combinators locals locals.backend locals.types
quotations.private combinators.private stack-checker.values quotations.private combinators.private stack-checker.values
generic.single generic.single.private generic.single generic.single.private
alien.libraries alien.libraries

View File

@ -3,12 +3,11 @@
USING: namespaces make continuations.private kernel.private init USING: namespaces make continuations.private kernel.private init
assocs kernel vocabs words sequences memory io system arrays assocs kernel vocabs words sequences memory io system arrays
continuations math definitions mirrors splitting parser classes continuations math definitions mirrors splitting parser classes
summary layouts vocabs.loader prettyprint.config prettyprint summary layouts vocabs.loader prettyprint.config prettyprint debugger
debugger io.streams.c io.files io.files.temp io.pathnames io.streams.c io.files io.files.temp io.pathnames io.directories
io.directories io.directories.hierarchy io.backend quotations io.directories.hierarchy io.backend quotations io.launcher
io.launcher words.private tools.deploy.config tools.deploy.config tools.deploy.config.editor bootstrap.image
tools.deploy.config.editor bootstrap.image io.encodings.utf8 io.encodings.utf8 destructors accessors hashtables ;
destructors accessors hashtables ;
IN: tools.deploy.backend IN: tools.deploy.backend
: copy-vm ( executable bundle-name -- vm ) : copy-vm ( executable bundle-name -- vm )

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors io.backend io.streams.c init fry USING: accessors io.backend io.streams.c init fry
namespaces make assocs kernel parser lexer strings.parser vocabs namespaces make assocs kernel parser lexer strings.parser vocabs
sequences words words.private memory kernel.private sequences words memory kernel.private
continuations io vocabs.loader system strings sets continuations io vocabs.loader system strings sets
vectors quotations byte-arrays sorting compiler.units vectors quotations byte-arrays sorting compiler.units
definitions generic generic.standard tools.deploy.config ; definitions generic generic.standard tools.deploy.config ;

View File

@ -98,7 +98,6 @@ bootstrapping? on
"threads.private" "threads.private"
"tools.profiler.private" "tools.profiler.private"
"words" "words"
"words.private"
"vectors" "vectors"
"vectors.private" "vectors.private"
} [ create-vocab drop ] each } [ create-vocab drop ] each
@ -339,7 +338,7 @@ tuple
[ create dup 1quotation ] dip define-declared ; [ create dup 1quotation ] dip define-declared ;
{ {
{ "(execute)" "words.private" (( word -- )) } { "(execute)" "kernel.private" (( word -- )) }
{ "(call)" "kernel.private" (( quot -- )) } { "(call)" "kernel.private" (( quot -- )) }
{ "both-fixnums?" "math.private" (( x y -- ? )) } { "both-fixnums?" "math.private" (( x y -- ? )) }
{ "fixnum+fast" "math.private" (( x y -- z )) } { "fixnum+fast" "math.private" (( x y -- z )) }

View File

@ -3,8 +3,7 @@
USING: accessors arrays assocs classes classes.algebra USING: accessors arrays assocs classes classes.algebra
combinators definitions generic hashtables kernel combinators definitions generic hashtables kernel
kernel.private layouts make math namespaces quotations kernel.private layouts make math namespaces quotations
sequences words generic.single.private words.private sequences words generic.single.private effects make ;
effects make ;
IN: generic.single IN: generic.single
ERROR: no-method object generic ; ERROR: no-method object generic ;
@ -127,13 +126,9 @@ TUPLE: tag-dispatch-engine methods ;
C: <tag-dispatch-engine> tag-dispatch-engine C: <tag-dispatch-engine> tag-dispatch-engine
: <engine> ( assoc -- engine ) : <engine> ( assoc -- engine )
dup keys [ not ] filter [ "FOO" throw ] unless-empty
flatten-methods flatten-methods
dup keys [ not ] filter [ "FOO1" throw ] unless-empty
convert-tuple-methods convert-tuple-methods
dup keys [ not ] filter [ "FOO2" throw ] unless-empty
convert-hi-tag-methods convert-hi-tag-methods
dup keys [ not ] filter [ "FOO3" throw ] unless-empty
<tag-dispatch-engine> ; <tag-dispatch-engine> ;
! ! ! Compile engine ! ! ! ! ! ! Compile engine ! ! !

View File

@ -183,6 +183,20 @@ HELP: either?
{ $example "USING: kernel math prettyprint ;" "5 7 [ even? ] either? ." "f" } { $example "USING: kernel math prettyprint ;" "5 7 [ even? ] either? ." "f" }
} ; } ;
HELP: execute
{ $values { "word" word } }
{ $description "Executes a word. Words which " { $link execute } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal word can have a static stack effect." }
{ $examples
{ $example "USING: kernel io words ;" "IN: scratchpad" ": twice ( word -- ) dup execute execute ; inline\n: hello ( -- ) \"Hello\" print ;\n\\ hello twice" "Hello\nHello" }
} ;
{ execute POSTPONE: execute( } related-words
HELP: (execute)
{ $values { "word" word } }
{ $description "Executes a word without checking if it is a word first." }
{ $warning "This word is in the " { $vocab-link "kernel.private" } " vocabulary because it is unsafe. Calling with a parameter that is not a word will crash Factor. Use " { $link execute } " instead." } ;
HELP: call HELP: call
{ $values { "callable" callable } } { $values { "callable" callable } }
{ $description "Calls a quotation. Words which " { $link call } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal quotation can have a static stack effect." } { $description "Calls a quotation. Words which " { $link call } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal quotation can have a static stack effect." }

View File

@ -1,5 +1,5 @@
USING: definitions help.markup help.syntax kernel parser USING: definitions help.markup help.syntax kernel parser
kernel.private words.private vocabs classes quotations kernel.private vocabs classes quotations
strings effects compiler.units ; strings effects compiler.units ;
IN: words IN: words
@ -163,15 +163,6 @@ $nl
ABOUT: "words" ABOUT: "words"
HELP: execute ( word -- )
{ $values { "word" word } }
{ $description "Executes a word. Words which " { $link execute } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal word can have a static stack effect." }
{ $examples
{ $example "USING: kernel io words ;" "IN: scratchpad" ": twice ( word -- ) dup execute execute ; inline\n: hello ( -- ) \"Hello\" print ;\n\\ hello twice" "Hello\nHello" }
} ;
{ execute POSTPONE: execute( } related-words
HELP: deferred HELP: deferred
{ $class-description "The class of deferred words created by " { $link POSTPONE: DEFER: } "." } ; { $class-description "The class of deferred words created by " { $link POSTPONE: DEFER: } "." } ;

View File

@ -1,9 +1,9 @@
! Copyright (C) 2004, 2009 Slava Pestov. ! Copyright (C) 2004, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays definitions graphs assocs kernel USING: accessors arrays definitions graphs assocs kernel
kernel.private slots.private math namespaces sequences strings kernel.private kernel.private slots.private math namespaces sequences
vectors sbufs quotations assocs hashtables sorting words.private strings vectors sbufs quotations assocs hashtables sorting vocabs
vocabs math.order sets ; math.order sets ;
IN: words IN: words
: word ( -- word ) \ word get-global ; : word ( -- word ) \ word get-global ;