Smarter FORGET:

db4
Slava Pestov 2008-01-09 17:57:59 -04:00
commit c738dee88e
5 changed files with 11 additions and 9 deletions

View File

@ -5,10 +5,7 @@ USING: alien arrays byte-arrays generic hashtables
hashtables.private io kernel math namespaces parser sequences hashtables.private io kernel math namespaces parser sequences
strings vectors words quotations assocs layouts classes tuples strings vectors words quotations assocs layouts classes tuples
kernel.private vocabs vocabs.loader source-files definitions kernel.private vocabs vocabs.loader source-files definitions
slots classes.union words.private compiler.units ; slots classes.union compiler.units ;
! Some very tricky code creating a bootstrap embryo in the
! host image.
"Creating primitives and basic runtime structures..." print flush "Creating primitives and basic runtime structures..." print flush

View File

@ -10,7 +10,8 @@ SYMBOL: with-compiler-errors?
: compiler-error ( error word -- ) : compiler-error ( error word -- )
with-compiler-errors? get [ with-compiler-errors? get [
compiler-errors get set-at compiler-errors get pick
[ set-at ] [ delete-at drop ] if
] [ 2drop ] if ; ] [ 2drop ] if ;
: compiler-error. ( error word -- ) : compiler-error. ( error word -- )

View File

@ -1,8 +1,8 @@
! Copyright (C) 2007, 2008 Slava Pestov. ! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: bootstrap.image.private kernel namespaces system USING: bootstrap.image.private kernel namespaces system
cpu.ppc.assembler generator.fixup compiler.constants math cpu.ppc.assembler generator.fixup compiler.units
layouts words vocabs ; compiler.constants math layouts words vocabs ;
IN: bootstrap.ppc IN: bootstrap.ppc
4 \ cell set 4 \ cell set

View File

@ -1,4 +1,4 @@
! Copyright (C) 2007 Slava Pestov. ! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: bootstrap.image.private kernel namespaces system USING: bootstrap.image.private kernel namespaces system
cpu.x86.assembler layouts compiler.units math generator.fixup cpu.x86.assembler layouts compiler.units math generator.fixup

View File

@ -157,7 +157,11 @@ IN: bootstrap.syntax
[ construct-boa ] curry define-inline [ construct-boa ] curry define-inline
] define-syntax ] define-syntax
"FORGET:" [ scan use get assoc-stack forget ] define-syntax "FORGET:" [
scan-word
dup parsing? [ V{ } clone swap execute first ] when
forget
] define-syntax
"(" [ "(" [
parse-effect word parse-effect word