From f3a8546b239bcaf6f7142fa52b98ae3293f2c743 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 2 Nov 2014 20:16:22 -0800 Subject: [PATCH] core: get rid of some unnecessary wrappers. --- basis/bootstrap/image/image.factor | 2 +- core/compiler/units/units.factor | 2 +- core/generic/single/single.factor | 2 +- core/sequences/sequences.factor | 2 +- core/source-files/source-files.factor | 4 ++-- core/vocabs/parser/parser.factor | 6 +++--- core/vocabs/vocabs.factor | 2 +- core/words/words.factor | 9 ++++----- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index c06883dc9a..b0bf307456 100755 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -568,7 +568,7 @@ M: quotation ' fixup-header "Image length: " write image get length . "Object cache size: " write objects get assoc-size . - \ last-word-symbol global delete-at + \ last-word global delete-at image get ; ! Image output diff --git a/core/compiler/units/units.factor b/core/compiler/units/units.factor index 517ee50bfa..7c4116c9f4 100644 --- a/core/compiler/units/units.factor +++ b/core/compiler/units/units.factor @@ -14,7 +14,7 @@ SYMBOL: new-definitions TUPLE: redefine-error def ; : throw-redefine-error ( definition -- ) - \ redefine-error boa throw-continue ; + redefine-error boa throw-continue ; ( methods -- engine ) convert-tuple-inheritance echelon-sort [ dupd ] assoc-map - \ tuple-dispatch-engine boa ; + tuple-dispatch-engine boa ; : convert-tuple-methods ( assoc -- assoc' ) tuple bootstrap-word diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index f27444df3f..b3f458bca4 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -108,7 +108,7 @@ ERROR: non-negative-integer-expected n ; : iota ( n -- iota ) dup 0 < [ non-negative-integer-expected ] when - \ iota-tuple boa ; inline + iota-tuple boa ; inline M: iota-tuple length n>> ; inline M: iota-tuple nth-unsafe drop ; inline diff --git a/core/source-files/source-files.factor b/core/source-files/source-files.factor index 1a2bfa7459..0b6774d0fc 100644 --- a/core/source-files/source-files.factor +++ b/core/source-files/source-files.factor @@ -27,7 +27,7 @@ main ; new-definitions get >>definitions drop ; : ( path -- source-file ) - \ source-file-tuple new + source-file-tuple new swap >>path >>definitions ; @@ -62,7 +62,7 @@ SYMBOL: file : wrap-source-file-error ( error -- * ) file get rollback-source-file - \ source-file-error new + source-file-error new f >>line# file get path>> >>file swap >>error rethrow ; diff --git a/core/vocabs/parser/parser.factor b/core/vocabs/parser/parser.factor index cd33131834..cb327432a2 100644 --- a/core/vocabs/parser/parser.factor +++ b/core/vocabs/parser/parser.factor @@ -19,7 +19,7 @@ ERROR: no-word-error name ; suffix ; : ( name possibilities -- error restarts ) - [ drop \ no-word-error boa ] [ word-restarts-with-defer ] 2bi ; + [ drop no-word-error boa ] [ word-restarts-with-defer ] 2bi ; TUPLE: manifest current-vocab @@ -89,7 +89,7 @@ PRIVATE> TUPLE: no-current-vocab-error ; : no-current-vocab ( -- vocab ) - \ no-current-vocab-error boa + no-current-vocab-error boa { { "Define words in scratchpad vocabulary" "scratchpad" } } throw-restarts dup set-current-vocab ; @@ -169,7 +169,7 @@ TUPLE: rename word vocab words ; TUPLE: ambiguous-use-error words ; : ( words -- error restarts ) - [ \ ambiguous-use-error boa ] [ word-restarts ] bi ; + [ ambiguous-use-error boa ] [ word-restarts ] bi ; ( name -- vocab ) - \ vocab new + vocab new swap >>name H{ } clone >>words ; diff --git a/core/words/words.factor b/core/words/words.factor index 7110cb24e5..d1cdd8b825 100644 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -16,11 +16,9 @@ BUILTIN: word ! also looking for classes : word ( -- * ) "dummy word" throw ; -SYMBOL: last-word-symbol +: last-word ( -- word ) \ last-word get-global ; -: last-word ( -- word ) \ last-word-symbol get-global ; - -: set-last-word ( word -- ) \ last-word-symbol set-global ; +: set-last-word ( word -- ) \ last-word set-global ; M: word execute (execute) ; @@ -52,7 +50,8 @@ M: word definition def>> ; PRIVATE> TUPLE: undefined-word word ; -: undefined ( -- * ) callstack caller \ undefined-word boa throw ; + +: undefined ( -- * ) callstack caller undefined-word boa throw ; : undefined-def ( -- quot ) #! 'f' inhibits tail call optimization in non-optimizing -- 2.34.1