From 1c10196c43f7872601a0607a7db9883f71839780 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 13 Jan 2010 18:08:18 +1300 Subject: [PATCH] Rename kernel.private:getenv/setenv to special-object/set-special-object to mirror recent renaming on the VM side --- .../remote-control/remote-control.factor | 6 +- basis/bootstrap/image/image.factor | 98 +++++++++---------- basis/bootstrap/image/syntax/syntax.factor | 10 +- basis/cocoa/application/application.factor | 2 +- basis/command-line/command-line.factor | 3 +- .../compiler/cfg/intrinsics/intrinsics.factor | 2 +- .../compiler/cfg/intrinsics/misc/misc.factor | 4 +- basis/compiler/codegen/codegen.factor | 4 +- basis/compiler/tests/intrinsics.factor | 4 +- .../known-words/known-words.factor | 6 +- basis/threads/threads.factor | 16 +-- basis/tools/deploy/shaker/shaker.factor | 4 +- basis/tools/deploy/shaker/strip-cocoa.factor | 2 +- basis/vm/vm.factor | 4 +- core/alien/strings/strings.factor | 4 +- core/bootstrap/primitives.factor | 4 +- core/combinators/combinators.factor | 4 +- core/compiler/units/units.factor | 8 +- core/continuations/continuations.factor | 16 +-- core/init/init.factor | 8 +- core/io/files/files.factor | 4 +- core/io/streams/c/c.factor | 6 +- core/kernel/kernel-docs.factor | 8 +- core/layouts/layouts.factor | 2 +- core/namespaces/namespaces.factor | 6 +- core/system/system.factor | 2 +- 26 files changed, 122 insertions(+), 115 deletions(-) diff --git a/basis/alien/remote-control/remote-control.factor b/basis/alien/remote-control/remote-control.factor index 6a5644cceb..ae694bed9c 100644 --- a/basis/alien/remote-control/remote-control.factor +++ b/basis/alien/remote-control/remote-control.factor @@ -19,8 +19,8 @@ IN: alien.remote-control dup optimized? [ execute ] [ drop f ] if ; inline : init-remote-control ( -- ) - \ eval-callback ?callback 16 setenv - \ yield-callback ?callback 17 setenv - \ sleep-callback ?callback 18 setenv ; + \ eval-callback ?callback 16 set-special-object + \ yield-callback ?callback 17 set-special-object + \ sleep-callback ?callback 18 set-special-object ; MAIN: init-remote-control diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index 1565373cab..90b4c3ae6f 100644 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2004, 2009 Slava Pestov. +! Copyright (C) 2004, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.strings arrays byte-arrays generic hashtables hashtables.private io io.binary io.files io.encodings.binary @@ -93,7 +93,7 @@ CONSTANT: image-version 4 CONSTANT: data-base 1024 -CONSTANT: userenv-size 70 +CONSTANT: special-objects-size 70 CONSTANT: header-size 10 @@ -176,58 +176,58 @@ SYMBOL: architecture RESET ! Boot quotation, set in stage1.factor -USERENV: bootstrap-startup-quot 20 +SPECIAL-OBJECT: bootstrap-startup-quot 20 ! Bootstrap global namesapce -USERENV: bootstrap-global 21 +SPECIAL-OBJECT: bootstrap-global 21 ! JIT parameters -USERENV: jit-prolog 23 -USERENV: jit-primitive-word 24 -USERENV: jit-primitive 25 -USERENV: jit-word-jump 26 -USERENV: jit-word-call 27 -USERENV: jit-if-word 28 -USERENV: jit-if 29 -USERENV: jit-epilog 30 -USERENV: jit-return 31 -USERENV: jit-profiling 32 -USERENV: jit-push 33 -USERENV: jit-dip-word 34 -USERENV: jit-dip 35 -USERENV: jit-2dip-word 36 -USERENV: jit-2dip 37 -USERENV: jit-3dip-word 38 -USERENV: jit-3dip 39 -USERENV: jit-execute 40 -USERENV: jit-declare-word 41 +SPECIAL-OBJECT: jit-prolog 23 +SPECIAL-OBJECT: jit-primitive-word 24 +SPECIAL-OBJECT: jit-primitive 25 +SPECIAL-OBJECT: jit-word-jump 26 +SPECIAL-OBJECT: jit-word-call 27 +SPECIAL-OBJECT: jit-if-word 28 +SPECIAL-OBJECT: jit-if 29 +SPECIAL-OBJECT: jit-epilog 30 +SPECIAL-OBJECT: jit-return 31 +SPECIAL-OBJECT: jit-profiling 32 +SPECIAL-OBJECT: jit-push 33 +SPECIAL-OBJECT: jit-dip-word 34 +SPECIAL-OBJECT: jit-dip 35 +SPECIAL-OBJECT: jit-2dip-word 36 +SPECIAL-OBJECT: jit-2dip 37 +SPECIAL-OBJECT: jit-3dip-word 38 +SPECIAL-OBJECT: jit-3dip 39 +SPECIAL-OBJECT: jit-execute 40 +SPECIAL-OBJECT: jit-declare-word 41 -USERENV: c-to-factor-word 42 -USERENV: lazy-jit-compile-word 43 -USERENV: unwind-native-frames-word 44 +SPECIAL-OBJECT: c-to-factor-word 42 +SPECIAL-OBJECT: lazy-jit-compile-word 43 +SPECIAL-OBJECT: unwind-native-frames-word 44 -USERENV: callback-stub 48 +SPECIAL-OBJECT: callback-stub 48 ! PIC stubs -USERENV: pic-load 49 -USERENV: pic-tag 50 -USERENV: pic-tuple 51 -USERENV: pic-check-tag 52 -USERENV: pic-check-tuple 53 -USERENV: pic-hit 54 -USERENV: pic-miss-word 55 -USERENV: pic-miss-tail-word 56 +SPECIAL-OBJECT: pic-load 49 +SPECIAL-OBJECT: pic-tag 50 +SPECIAL-OBJECT: pic-tuple 51 +SPECIAL-OBJECT: pic-check-tag 52 +SPECIAL-OBJECT: pic-check-tuple 53 +SPECIAL-OBJECT: pic-hit 54 +SPECIAL-OBJECT: pic-miss-word 55 +SPECIAL-OBJECT: pic-miss-tail-word 56 ! Megamorphic dispatch -USERENV: mega-lookup 57 -USERENV: mega-lookup-word 58 -USERENV: mega-miss-word 59 +SPECIAL-OBJECT: mega-lookup 57 +SPECIAL-OBJECT: mega-lookup-word 58 +SPECIAL-OBJECT: mega-miss-word 59 ! Default definition for undefined words -USERENV: undefined-quot 60 +SPECIAL-OBJECT: undefined-quot 60 -: userenv-offset ( symbol -- n ) - userenvs get at header-size + ; +: special-object-offset ( symbol -- n ) + special-objects get at header-size + ; : emit ( cell -- ) image get push ; @@ -243,7 +243,7 @@ USERENV: undefined-quot 60 : fixup ( value offset -- ) image get set-nth ; : heap-size ( -- size ) - image get length header-size - userenv-size - + image get length header-size - special-objects-size - bootstrap-cells ; : here ( -- size ) heap-size data-base + ; @@ -282,10 +282,10 @@ GENERIC: ' ( obj -- ptr ) 0 emit ! pointer to bignum 0 0 emit ! pointer to bignum 1 0 emit ! pointer to bignum -1 - userenv-size [ f ' emit ] times ; + special-objects-size [ f ' emit ] times ; -: emit-userenv ( symbol -- ) - [ get ' ] [ userenv-offset ] bi fixup ; +: emit-special-object ( symbol -- ) + [ get ' ] [ special-object-offset ] bi fixup ; ! Bignums @@ -548,8 +548,8 @@ M: quotation ' \ unwind-native-frames unwind-native-frames-word set [ undefined ] undefined-quot set ; -: emit-userenvs ( -- ) - userenvs get keys [ emit-userenv ] each ; +: emit-special-objects ( -- ) + special-objects get keys [ emit-special-object ] each ; : fixup-header ( -- ) heap-size data-heap-size-offset fixup ; @@ -566,8 +566,8 @@ M: quotation ' emit-jit-data "Serializing global namespace..." print flush emit-global - "Serializing user environment..." print flush - emit-userenvs + "Serializing special object table..." print flush + emit-special-objects "Performing word fixups..." print flush fixup-words "Performing header fixups..." print flush diff --git a/basis/bootstrap/image/syntax/syntax.factor b/basis/bootstrap/image/syntax/syntax.factor index 29dc09717a..7025cd61e1 100644 --- a/basis/bootstrap/image/syntax/syntax.factor +++ b/basis/bootstrap/image/syntax/syntax.factor @@ -1,14 +1,14 @@ -! Copyright (C) 2009 Slava Pestov. +! Copyright (C) 2009, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: parser kernel namespaces assocs words.symbol ; IN: bootstrap.image.syntax -SYMBOL: userenvs +SYMBOL: special-objects -SYNTAX: RESET H{ } clone userenvs set-global ; +SYNTAX: RESET H{ } clone special-objects set-global ; -SYNTAX: USERENV: +SYNTAX: SPECIAL-OBJECT: CREATE-WORD scan-word - [ swap userenvs get set-at ] + [ swap special-objects get set-at ] [ drop define-symbol ] 2bi ; \ No newline at end of file diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index 83213b47ba..df56ce5c4c 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -49,7 +49,7 @@ TUPLE: objc-error alien reason ; M: objc-error summary ( error -- ) drop "Objective C exception" ; -[ [ objc-error ] 19 setenv ] "cocoa.application" add-startup-hook +[ [ objc-error ] 19 set-special-object ] "cocoa.application" add-startup-hook : running.app? ( -- ? ) #! Test if we're running a .app. diff --git a/basis/command-line/command-line.factor b/basis/command-line/command-line.factor index f1748d3708..939fb82f00 100644 --- a/basis/command-line/command-line.factor +++ b/basis/command-line/command-line.factor @@ -8,7 +8,8 @@ IN: command-line SYMBOL: script SYMBOL: command-line -: (command-line) ( -- args ) 10 getenv sift [ alien>native-string ] map ; +: (command-line) ( -- args ) + 10 special-object sift [ alien>native-string ] map ; : rc-path ( name -- path ) os windows? [ "." prepend ] unless diff --git a/basis/compiler/cfg/intrinsics/intrinsics.factor b/basis/compiler/cfg/intrinsics/intrinsics.factor index e8c93899cb..d753a4c1b4 100644 --- a/basis/compiler/cfg/intrinsics/intrinsics.factor +++ b/basis/compiler/cfg/intrinsics/intrinsics.factor @@ -30,7 +30,7 @@ IN: compiler.cfg.intrinsics { { kernel.private:tag [ drop emit-tag ] } - { kernel.private:getenv [ emit-getenv ] } + { kernel.private:special-object [ emit-special-object ] } { kernel.private:(identity-hashcode) [ drop emit-identity-hashcode ] } { math.private:both-fixnums? [ drop emit-both-fixnums? ] } { math.private:fixnum+ [ drop emit-fixnum+ ] } diff --git a/basis/compiler/cfg/intrinsics/misc/misc.factor b/basis/compiler/cfg/intrinsics/misc/misc.factor index a477ef4b95..fed5492220 100644 --- a/basis/compiler/cfg/intrinsics/misc/misc.factor +++ b/basis/compiler/cfg/intrinsics/misc/misc.factor @@ -9,8 +9,8 @@ IN: compiler.cfg.intrinsics.misc : emit-tag ( -- ) ds-pop tag-mask get ^^and-imm ^^tag-fixnum ds-push ; -: emit-getenv ( node -- ) - "userenv" ^^vm-field-ptr +: emit-special-object ( node -- ) + "special-objects" ^^vm-field-ptr swap node-input-infos first literal>> [ ds-drop 0 ^^slot-imm ] [ ds-pop ^^offset>slot ^^slot ] if* ds-push ; diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index cea6527259..d408c722ff 100644 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -474,7 +474,7 @@ M: ##alien-indirect generate-insn TUPLE: callback-context ; -: current-callback ( -- id ) 2 getenv ; +: current-callback ( -- id ) 2 special-object ; : wait-to-return ( token -- ) dup current-callback eq? [ @@ -485,7 +485,7 @@ TUPLE: callback-context ; : do-callback ( quot token -- ) init-catchstack - [ 2 setenv call ] keep + [ 2 set-special-object call ] keep wait-to-return ; inline : callback-return-quot ( ctype -- quot ) diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index 7fe5e2b601..37b3a75071 100644 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -54,8 +54,8 @@ IN: compiler.tests.intrinsics [ HEX: 123456 ] [ 1 [ "a\u123456c" string-nth ] compile-call ] unit-test [ HEX: 123456 ] [ [ 1 "a\u123456c" string-nth ] compile-call ] unit-test -[ ] [ [ 0 getenv ] compile-call drop ] unit-test -[ ] [ 1 getenv [ 1 setenv ] compile-call ] unit-test +[ ] [ [ 0 special-object ] compile-call drop ] unit-test +[ ] [ 1 special-object [ 1 set-special-object ] compile-call ] unit-test [ ] [ 1 [ drop ] compile-call ] unit-test [ ] [ [ 1 drop ] compile-call ] unit-test diff --git a/basis/stack-checker/known-words/known-words.factor b/basis/stack-checker/known-words/known-words.factor index a95d110622..bbd8ecc407 100644 --- a/basis/stack-checker/known-words/known-words.factor +++ b/basis/stack-checker/known-words/known-words.factor @@ -489,10 +489,10 @@ M: bad-executable summary \ word-xt { word } { integer integer } define-primitive \ word-xt make-flushable -\ getenv { fixnum } { object } define-primitive -\ getenv make-flushable +\ special-object { fixnum } { object } define-primitive +\ special-object make-flushable -\ setenv { object fixnum } { } define-primitive +\ set-special-object { object fixnum } { } define-primitive \ (exists?) { string } { object } define-primitive diff --git a/basis/threads/threads.factor b/basis/threads/threads.factor index 9d1cd29337..952652d801 100644 --- a/basis/threads/threads.factor +++ b/basis/threads/threads.factor @@ -21,7 +21,7 @@ mailbox variables sleep-entry ; -: self ( -- thread ) 63 getenv ; inline +: self ( -- thread ) 63 special-object ; inline ! Thread-local storage : tnamespace ( -- assoc ) @@ -36,7 +36,7 @@ sleep-entry ; : tchange ( key quot -- ) tnamespace swap change-at ; inline -: threads ( -- assoc ) 64 getenv ; +: threads ( -- assoc ) 64 special-object ; : thread ( id -- thread ) threads at ; @@ -61,7 +61,7 @@ ERROR: not-running thread ; : unregister-thread ( thread -- ) check-registered id>> threads delete-at ; -: set-self ( thread -- ) 63 setenv ; inline +: set-self ( thread -- ) 63 set-special-object ; inline PRIVATE> @@ -75,9 +75,9 @@ PRIVATE> : ( quot name -- thread ) \ thread new-thread ; -: run-queue ( -- dlist ) 65 getenv ; +: run-queue ( -- dlist ) 65 special-object ; -: sleep-queue ( -- heap ) 66 getenv ; +: sleep-queue ( -- heap ) 66 special-object ; : resume ( thread -- ) f >>state @@ -216,9 +216,9 @@ GENERIC: error-in-thread ( error thread -- ) 65 setenv - 66 setenv + H{ } clone 64 set-special-object + 65 set-special-object + 66 set-special-object initial-thread global [ drop [ ] "Initial" ] cache >>continuation diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index ea02aa03c9..06009992ad 100644 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -393,7 +393,7 @@ IN: tools.deploy.shaker '[ drop _ member? not ] assoc-filter [ drop string? not ] assoc-filter ! strip CLI args sift-assoc - 21 setenv + 21 set-special-object ] [ drop ] if ; : strip-c-io ( -- ) @@ -518,7 +518,7 @@ SYMBOL: deploy-vocab strip-c-io strip-default-methods strip-compiler-classes - f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore + f 5 set-special-object ! we can't use the Factor debugger or Factor I/O anymore deploy-vocab get vocab-main deploy-startup-quot find-megamorphic-caches stripped-word-props diff --git a/basis/tools/deploy/shaker/strip-cocoa.factor b/basis/tools/deploy/shaker/strip-cocoa.factor index d5c5bd54da..7bb2f651dc 100644 --- a/basis/tools/deploy/shaker/strip-cocoa.factor +++ b/basis/tools/deploy/shaker/strip-cocoa.factor @@ -17,7 +17,7 @@ IN: cocoa.application : objc-error ( error -- ) die ; -[ [ die ] 19 setenv ] "cocoa.application" add-startup-hook +[ [ die ] 19 set-special-object ] "cocoa.application" add-startup-hook H{ } clone \ pool [ global [ diff --git a/basis/vm/vm.factor b/basis/vm/vm.factor index 20428c40f3..cc4a291a8b 100644 --- a/basis/vm/vm.factor +++ b/basis/vm/vm.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2009 Phil Dawes. +! Copyright (C) 2009, 2010 Phil Dawes, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: classes.struct alien.c-types alien.syntax ; IN: vm @@ -30,7 +30,7 @@ STRUCT: vm { nursery zone } { cards-offset cell } { decks-offset cell } -{ userenv cell[70] } ; +{ special-objects cell[70] } ; : vm-field-offset ( field -- offset ) vm offset-of ; inline diff --git a/core/alien/strings/strings.factor b/core/alien/strings/strings.factor index 8e09fa8c2c..15e0370ba0 100644 --- a/core/alien/strings/strings.factor +++ b/core/alien/strings/strings.factor @@ -67,6 +67,6 @@ M: string string>symbol string>symbol* ; M: sequence string>symbol [ string>symbol* ] map ; [ - 8 getenv utf8 alien>string string>cpu \ cpu set-global - 9 getenv utf8 alien>string string>os \ os set-global + 8 special-object utf8 alien>string string>cpu \ cpu set-global + 9 special-object utf8 alien>string string>os \ os set-global ] "alien.strings" add-startup-hook diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index a0b278c7a4..2a791bf42d 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -421,8 +421,8 @@ tuple { "float-u>=" "math.private" (( x y -- ? )) } { "(word)" "words.private" (( name vocab -- word )) } { "word-xt" "words" (( word -- start end )) } - { "getenv" "kernel.private" (( n -- obj )) } - { "setenv" "kernel.private" (( obj n -- )) } + { "special-object" "kernel.private" (( n -- obj )) } + { "set-special-object" "kernel.private" (( obj n -- )) } { "(exists?)" "io.files.private" (( path -- ? )) } { "minor-gc" "memory" (( -- )) } { "gc" "memory" (( -- )) } diff --git a/core/combinators/combinators.factor b/core/combinators/combinators.factor index 2bef1a568a..55cc55c334 100644 --- a/core/combinators/combinators.factor +++ b/core/combinators/combinators.factor @@ -11,7 +11,9 @@ IN: combinators : execute-effect-unsafe ( word effect -- ) drop execute ; -M: object throw 5 getenv [ die ] or (( error -- * )) call-effect-unsafe ; +M: object throw + 5 special-object [ die ] or + (( error -- * )) call-effect-unsafe ; PRIVATE> diff --git a/core/compiler/units/units.factor b/core/compiler/units/units.factor index 996a6e9bd4..a64080e510 100644 --- a/core/compiler/units/units.factor +++ b/core/compiler/units/units.factor @@ -100,7 +100,7 @@ GENERIC: definitions-changed ( assoc obj -- ) ! Incremented each time stack effects potentially changed, used ! by compiler.tree.propagation.call-effect for call( and execute( ! inline caching -: effect-counter ( -- n ) 47 getenv ; inline +: effect-counter ( -- n ) 47 special-object ; inline GENERIC: bump-effect-counter* ( defspec -- ? ) @@ -132,7 +132,11 @@ M: object bump-effect-counter* drop f ; or ; : bump-effect-counter ( -- ) - bump-effect-counter? [ 47 getenv 0 or 1 + 47 setenv ] when ; + bump-effect-counter? [ + 47 special-object 0 or + 1 + + 47 set-special-object + ] when ; : notify-observers ( -- ) updated-definitions dup assoc-empty? diff --git a/core/continuations/continuations.factor b/core/continuations/continuations.factor index 02c129aefe..d63acae883 100644 --- a/core/continuations/continuations.factor +++ b/core/continuations/continuations.factor @@ -13,7 +13,7 @@ SYMBOL: restarts c ( continuation -- ) catchstack* push ; @@ -23,13 +23,13 @@ SYMBOL: restarts : dummy-1 ( -- obj ) f ; : dummy-2 ( obj -- obj ) dup drop ; -: init-catchstack ( -- ) V{ } clone 1 setenv ; +: init-catchstack ( -- ) V{ } clone 1 set-special-object ; PRIVATE> : catchstack ( -- catchstack ) catchstack* clone ; inline -: set-catchstack ( catchstack -- ) >vector 1 setenv ; inline +: set-catchstack ( catchstack -- ) >vector 1 set-special-object ; inline TUPLE: continuation data call retain name catch ; @@ -71,12 +71,12 @@ PRIVATE> : continue-with ( obj continuation -- * ) [ - swap 4 setenv + swap 4 set-special-object >continuation< set-catchstack set-namestack set-retainstack - [ set-datastack drop 4 getenv f 4 setenv f ] dip + [ set-datastack drop 4 special-object f 4 set-special-object f ] dip set-callstack ] (( obj continuation -- * )) call-effect-unsafe ; @@ -173,12 +173,12 @@ M: condition compute-restarts ! VM calls on error [ ! 63 = self - 63 getenv error-thread set-global + 63 special-object error-thread set-global continuation error-continuation set-global rethrow - ] 5 setenv + ] 5 set-special-object ! VM adds this to kernel errors, so that user-space ! can identify them - "kernel-error" 6 setenv ; + "kernel-error" 6 set-special-object ; PRIVATE> diff --git a/core/init/init.factor b/core/init/init.factor index 40e5806fd5..4e2d4b16a1 100644 --- a/core/init/init.factor +++ b/core/init/init.factor @@ -27,12 +27,12 @@ shutdown-hooks global [ drop V{ } clone ] cache drop : boot ( -- ) init-namespaces init-catchstack init-error-handler ; -: startup-quot ( -- quot ) 20 getenv ; +: startup-quot ( -- quot ) 20 special-object ; -: set-startup-quot ( quot -- ) 20 setenv ; +: set-startup-quot ( quot -- ) 20 set-special-object ; -: shutdown-quot ( -- quot ) 22 getenv ; +: shutdown-quot ( -- quot ) 22 special-object ; -: set-shutdown-quot ( quot -- ) 22 setenv ; +: set-shutdown-quot ( quot -- ) 22 set-special-object ; [ do-shutdown-hooks ] set-shutdown-quot diff --git a/core/io/files/files.factor b/core/io/files/files.factor index 9824fba18c..86d02acdd1 100644 --- a/core/io/files/files.factor +++ b/core/io/files/files.factor @@ -57,7 +57,7 @@ PRIVATE> [ cwd current-directory set-global - 13 getenv alien>native-string cwd prepend-path \ image set-global - 14 getenv alien>native-string cwd prepend-path \ vm set-global + 13 special-object alien>native-string cwd prepend-path \ image set-global + 14 special-object alien>native-string cwd prepend-path \ vm set-global image parent-directory "resource-path" set-global ] "io.files" add-startup-hook diff --git a/core/io/streams/c/c.factor b/core/io/streams/c/c.factor index cb978d5deb..d26f03aa5e 100644 --- a/core/io/streams/c/c.factor +++ b/core/io/streams/c/c.factor @@ -61,9 +61,9 @@ M: c-reader stream-read-until M: c-io-backend init-io ; -: stdin-handle ( -- alien ) 11 getenv ; -: stdout-handle ( -- alien ) 12 getenv ; -: stderr-handle ( -- alien ) 61 getenv ; +: stdin-handle ( -- alien ) 11 special-object ; +: stdout-handle ( -- alien ) 12 special-object ; +: stderr-handle ( -- alien ) 61 special-object ; : init-c-stdio ( -- ) stdin-handle diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index 89ac1c9a05..7c80990d7a 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -655,13 +655,13 @@ HELP: tag ( object -- n ) { $values { "object" object } { "n" "a tag number" } } { $description "Outputs an object's tag number, between zero and one less than " { $link num-types } ". This is implementation detail and user code should call " { $link class } " instead." } ; -HELP: getenv ( n -- obj ) +HELP: special-object ( n -- obj ) { $values { "n" "a non-negative integer" } { "obj" object } } -{ $description "Reads an object from the Factor VM's environment table. User code never has to read the environment table directly; instead, use one of the callers of this word." } ; +{ $description "Reads an object from the Factor VM's special object table. User code never has to read the special object table directly; instead, use one of the callers of this word." } ; -HELP: setenv ( obj n -- ) +HELP: set-special-object ( obj n -- ) { $values { "obj" object } { "n" "a non-negative integer" } } -{ $description "Writes an object to the Factor VM's environment table. User code never has to write to the environment table directly; instead, use one of the callers of this word." } ; +{ $description "Writes an object to the Factor VM's special object table. User code never has to write to the special object table directly; instead, use one of the callers of this word." } ; HELP: object { $class-description diff --git a/core/layouts/layouts.factor b/core/layouts/layouts.factor index 05fe03315c..5edb5d1d72 100644 --- a/core/layouts/layouts.factor +++ b/core/layouts/layouts.factor @@ -36,7 +36,7 @@ SYMBOL: header-bits ! We do this in its own compilation unit so that they can be ! folded below << -: cell ( -- n ) 7 getenv ; foldable +: cell ( -- n ) 7 special-object ; foldable : (first-bignum) ( m -- n ) tag-bits get - 1 - 2^ ; foldable >> diff --git a/core/namespaces/namespaces.factor b/core/namespaces/namespaces.factor index 9428445d26..40b1db8a3f 100644 --- a/core/namespaces/namespaces.factor +++ b/core/namespaces/namespaces.factor @@ -6,7 +6,7 @@ IN: namespaces n ( namespace -- ) namestack* push ; : ndrop ( -- ) namestack* pop* ; @@ -14,8 +14,8 @@ PRIVATE> : namespace ( -- namespace ) namestack* last ; inline : namestack ( -- namestack ) namestack* clone ; -: set-namestack ( namestack -- ) >vector 0 setenv ; -: global ( -- g ) 21 getenv { hashtable } declare ; inline +: set-namestack ( namestack -- ) >vector 0 set-special-object ; +: global ( -- g ) 21 special-object { hashtable } declare ; inline : init-namespaces ( -- ) global 1array set-namestack ; : get ( variable -- value ) namestack* assoc-stack ; inline : set ( value variable -- ) namespace set-at ; diff --git a/core/system/system.factor b/core/system/system.factor index 59f2a030ce..715564c64d 100644 --- a/core/system/system.factor +++ b/core/system/system.factor @@ -53,6 +53,6 @@ PRIVATE> : vm ( -- path ) \ vm get-global ; -: embedded? ( -- ? ) 15 getenv ; +: embedded? ( -- ? ) 15 special-object ; : exit ( n -- ) do-shutdown-hooks (exit) ;