factor: cleaning up more syntax.
parent
77db8f128f
commit
552d323897
|
@ -6,7 +6,7 @@ destructors io io.encodings.string io.encodings.utf8 kernel locals
|
|||
math math.parser namespaces sequences strings ;
|
||||
in: cuda.demos.hello-world
|
||||
|
||||
CUDA-library: hello cuda32 "vocab:cuda/demos/hello-world/hello.ptx"
|
||||
CUDA-LIBRARY: hello cuda32 "vocab:cuda/demos/hello-world/hello.ptx" ;
|
||||
|
||||
CUDA-FUNCTION: helloWorld ( char* string-ptr ) ;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: alien.c-types cuda cuda.contexts cuda.libraries cuda.syntax locals ;
|
||||
in: cuda.demos.prefix-sum
|
||||
|
||||
CUDA-library: prefix-sum cuda32 "vocab:cuda/demos/prefix-sum/prefix-sum.ptx"
|
||||
CUDA-LIBRARY: prefix-sum cuda32 "vocab:cuda/demos/prefix-sum/prefix-sum.ptx" ;
|
||||
|
||||
CUDA-FUNCTION: prefix_sum_block ( uint* in, uint* out, uint n ) ;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ PREDICATE: cuda-function-word < word
|
|||
def>> { [ length 14 = ] [ last \ cuda-invoke eq? ] } 1&& ;
|
||||
|
||||
: pprint-cuda-library ( library -- )
|
||||
[ \ CUDA-library: [ text ] pprint-prefix ] when* ;
|
||||
[ \ CUDA-LIBRARY: [ text ] pprint-prefix ] when* ;
|
||||
|
||||
: pprint-cuda-function ( word quot -- )
|
||||
[
|
||||
|
|
|
@ -4,15 +4,15 @@ USING: alien.parser cuda.libraries fry kernel lexer namespaces
|
|||
parser ;
|
||||
in: cuda.syntax
|
||||
|
||||
SYNTAX: CUDA-library:
|
||||
scan-token scan-word scan-object
|
||||
SYNTAX: \ CUDA-LIBRARY:
|
||||
scan-token scan-word scan-object ";" expect
|
||||
'[ _ _ add-cuda-library ]
|
||||
[ current-cuda-library set-global ] bi ;
|
||||
|
||||
SYNTAX: CUDA-FUNCTION:
|
||||
SYNTAX: \ CUDA-FUNCTION:
|
||||
scan-token [ create-word-in current-cuda-library get ] keep
|
||||
scan-c-args ";" expect define-cuda-function ;
|
||||
|
||||
SYNTAX: CUDA-GLOBAL:
|
||||
SYNTAX: \ cuda-global:
|
||||
scan-token [ create-word-in current-cuda-library get ] keep
|
||||
define-cuda-global ;
|
||||
|
|
|
@ -65,9 +65,9 @@ M: word <c-direct-array>
|
|||
M: pointer <c-direct-array>
|
||||
drop void* <c-direct-array> ;
|
||||
|
||||
SYNTAX: c-array{ \ } [ unclip >c-array ] parse-literal ;
|
||||
SYNTAX: \ c-array{ \ } [ unclip >c-array ] parse-literal ;
|
||||
|
||||
SYNTAX: c-array@
|
||||
SYNTAX: \ c-array@
|
||||
scan-object [ scan-object scan-object ] dip
|
||||
<c-direct-array> suffix! ;
|
||||
|
||||
|
|
|
@ -123,8 +123,8 @@ MACRO: data-map! ( ins outs -- quot )
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: data-map(
|
||||
SYNTAX: \ data-map(
|
||||
parse-data-map-effect \ data-map suffix! ;
|
||||
|
||||
SYNTAX: data-map!(
|
||||
SYNTAX: \ data-map!(
|
||||
parse-data-map-effect \ data-map! suffix! ;
|
||||
|
|
|
@ -145,18 +145,18 @@ ERROR: unsupported-endian-type endian slot ;
|
|||
[ compute-struct-offsets ] [ drop 1 ]
|
||||
(define-struct-class) ;
|
||||
|
||||
SYNTAX: LE-STRUCT:
|
||||
SYNTAX: \ LE-STRUCT:
|
||||
parse-struct-definition
|
||||
little-endian define-endian-struct-class ;
|
||||
|
||||
SYNTAX: BE-STRUCT:
|
||||
SYNTAX: \ BE-STRUCT:
|
||||
parse-struct-definition
|
||||
big-endian define-endian-struct-class ;
|
||||
|
||||
SYNTAX: LE-PACKED-STRUCT:
|
||||
SYNTAX: \ LE-PACKED-STRUCT:
|
||||
parse-struct-definition
|
||||
little-endian define-endian-packed-struct-class ;
|
||||
|
||||
SYNTAX: BE-PACKED-STRUCT:
|
||||
SYNTAX: \ BE-PACKED-STRUCT:
|
||||
parse-struct-definition
|
||||
big-endian define-endian-packed-struct-class ;
|
||||
|
|
|
@ -440,20 +440,15 @@ MACRO: fortran-invoke ( return library function parameters -- quot )
|
|||
return library function parameters return [ c:void ] unless* parse-arglist
|
||||
[ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ;
|
||||
|
||||
SYNTAX: SUBROUTINE:
|
||||
SYNTAX: \ SUBROUTINE:
|
||||
f current-library get scan-token ")" parse-tokens
|
||||
[ "()" subseq? ] reject ";" expect define-fortran-function ;
|
||||
|
||||
SYNTAX: FUNCTION:
|
||||
SYNTAX: \ FUNCTION:
|
||||
scan-token current-library get scan-token ")" parse-tokens
|
||||
[ "()" subseq? ] reject ";" expect define-fortran-function ;
|
||||
|
||||
SYNTAX: library:
|
||||
scan-token
|
||||
[ current-library set ]
|
||||
[ set-fortran-abi ] bi ;
|
||||
|
||||
SYNTAX: library:
|
||||
SYNTAX: \ library:
|
||||
scan-token
|
||||
[ current-library set ]
|
||||
[ set-fortran-abi ] bi ;
|
||||
|
|
|
@ -6,41 +6,41 @@ strings.parser vocabs words ;
|
|||
<< "alien.arrays" require >> ! needed for bootstrap
|
||||
in: alien.syntax
|
||||
|
||||
SYNTAX: DLL" lexer get skip-blank parse-string dlopen suffix! ;
|
||||
SYNTAX: \ DLL" lexer get skip-blank parse-string dlopen suffix! ;
|
||||
|
||||
SYNTAX: ALIEN: 16 scan-base <alien> suffix! ;
|
||||
SYNTAX: alien: 16 scan-base <alien> suffix! ;
|
||||
SYNTAX: \ ALIEN: 16 scan-base <alien> suffix! ;
|
||||
SYNTAX: \ alien: 16 scan-base <alien> suffix! ;
|
||||
|
||||
SYNTAX: BAD-ALIEN <bad-alien> suffix! ;
|
||||
|
||||
SYNTAX: LIBRARY: scan-token current-library set ;
|
||||
SYNTAX: library: scan-token current-library set ;
|
||||
SYNTAX: \ LIBRARY: scan-token current-library set ;
|
||||
SYNTAX: \ library: scan-token current-library set ;
|
||||
|
||||
SYNTAX: FUNCTION:
|
||||
SYNTAX: \ FUNCTION:
|
||||
(FUNCTION:) make-function define-inline ;
|
||||
|
||||
SYNTAX: FUNCTION-ALIAS:
|
||||
SYNTAX: \ FUNCTION-ALIAS:
|
||||
scan-token create-function
|
||||
(FUNCTION:) (make-function) define-inline ;
|
||||
|
||||
SYNTAX: CALLBACK:
|
||||
SYNTAX: \ CALLBACK:
|
||||
(CALLBACK:) define-inline ;
|
||||
|
||||
SYNTAX: TYPEDEF:
|
||||
SYNTAX: \ TYPEDEF:
|
||||
scan-c-type CREATE-C-TYPE ";" expect dup save-location typedef ;
|
||||
|
||||
SYNTAX: ENUM:
|
||||
SYNTAX: \ ENUM:
|
||||
parse-enum (define-enum) ;
|
||||
|
||||
SYNTAX: C-TYPE:
|
||||
SYNTAX: \ C-TYPE:
|
||||
void CREATE-C-TYPE typedef ;
|
||||
SYNTAX: c-type:
|
||||
SYNTAX: \ c-type:
|
||||
void CREATE-C-TYPE typedef ;
|
||||
|
||||
SYNTAX: &:
|
||||
SYNTAX: \ &:
|
||||
scan-token current-library get '[ _ _ address-of ] append! ;
|
||||
|
||||
SYNTAX: C-GLOBAL: scan-c-type scan-new-word ";" expect define-global ;
|
||||
SYNTAX: \ C-GLOBAL: scan-c-type scan-new-word ";" expect define-global ;
|
||||
|
||||
SYNTAX: pointer:
|
||||
SYNTAX: \ pointer:
|
||||
scan-c-type <pointer> suffix! ;
|
||||
|
|
|
@ -378,19 +378,19 @@ PRIVATE>
|
|||
dup [ name>> ] map check-duplicate-slots ;
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: STRUCT:
|
||||
SYNTAX: \ STRUCT:
|
||||
parse-struct-definition define-struct-class ;
|
||||
|
||||
SYNTAX: PACKED-STRUCT:
|
||||
SYNTAX: \ PACKED-STRUCT:
|
||||
parse-struct-definition define-packed-struct-class ;
|
||||
|
||||
SYNTAX: UNION-STRUCT:
|
||||
SYNTAX: \ UNION-STRUCT:
|
||||
parse-struct-definition define-union-struct-class ;
|
||||
|
||||
SYNTAX: S{
|
||||
SYNTAX: \ S{
|
||||
scan-word dup struct-slots parse-tuple-literal-slots suffix! ;
|
||||
|
||||
SYNTAX: S@
|
||||
SYNTAX: \ S@
|
||||
scan-word scan-object swap memory>struct suffix! ;
|
||||
|
||||
! functor support
|
||||
|
@ -412,7 +412,7 @@ SYNTAX: S@
|
|||
|
||||
PRIVATE>
|
||||
|
||||
FUNCTOR-SYNTAX: STRUCT:
|
||||
FUNCTOR-SYNTAX: \ STRUCT:
|
||||
scan-param suffix!
|
||||
[ 8 <vector> ] append!
|
||||
[ parse-struct-slots* ] [ ] while
|
||||
|
|
|
@ -113,5 +113,5 @@ M: T-array struct-transpose
|
|||
|
||||
FUNCTOR;
|
||||
|
||||
SYNTAX: VECTORED-STRUCT:
|
||||
SYNTAX: \ VECTORED-STRUCT:
|
||||
scan-word define-vectored-struct ;
|
||||
|
|
|
@ -88,14 +88,14 @@ TUPLE: insn-slot-spec type name rep ;
|
|||
[ nip define-insn-ctor ]
|
||||
} 3cleave ;
|
||||
|
||||
SYNTAX: INSN:
|
||||
SYNTAX: \ INSN:
|
||||
scan-new-class insn-word ";" parse-tokens define-insn ;
|
||||
|
||||
SYNTAX: VREG-INSN:
|
||||
SYNTAX: \ VREG-INSN:
|
||||
scan-new-class vreg-insn-word ";" parse-tokens define-insn ;
|
||||
|
||||
SYNTAX: FLUSHABLE-INSN:
|
||||
SYNTAX: \ FLUSHABLE-INSN:
|
||||
scan-new-class flushable-insn-word ";" parse-tokens define-insn ;
|
||||
|
||||
SYNTAX: FOLDABLE-INSN:
|
||||
SYNTAX: \ FOLDABLE-INSN:
|
||||
scan-new-class foldable-insn-word ";" parse-tokens define-insn ;
|
||||
|
|
|
@ -32,7 +32,7 @@ C: <ds-loc> ds-loc ;
|
|||
TUPLE: rs-loc < loc ;
|
||||
C: <rs-loc> rs-loc ;
|
||||
|
||||
SYNTAX: D: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: R: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: r: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: \ D: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: \ d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: \ R: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: \ r: scan-number <rs-loc> suffix! ;
|
||||
|
|
|
@ -85,4 +85,4 @@ insn-classes get [ insn-temp-slots empty? ] reject [
|
|||
|
||||
FUNCTOR;
|
||||
|
||||
SYNTAX: RENAMING: scan-token scan-object scan-object scan-object ";" expect define-renaming ;
|
||||
SYNTAX: \ RENAMING: scan-token scan-object scan-object scan-object ";" expect define-renaming ;
|
||||
|
|
|
@ -7,7 +7,7 @@ compiler.codegen.gc-maps compiler.codegen.labels
|
|||
compiler.codegen.relocation compiler.constants cpu.architecture
|
||||
fry generic.parser kernel layouts locals make math namespaces
|
||||
parser quotations sequences sequences.generalizations slots
|
||||
words ;
|
||||
words lexer ;
|
||||
in: compiler.codegen
|
||||
|
||||
symbol: insn-counts
|
||||
|
@ -128,185 +128,185 @@ M: ##epilogue generate-insn
|
|||
[ insn-slot-quot ] map cleave>quot
|
||||
] dip suffix ;
|
||||
|
||||
SYNTAX: CODEGEN:
|
||||
scan-word [ \ generate-insn create-method-in ] keep scan-word
|
||||
SYNTAX: \ CODEGEN:
|
||||
scan-word [ \ generate-insn create-method-in ] keep scan-word ";" expect
|
||||
codegen-method-body define ;
|
||||
|
||||
>>
|
||||
|
||||
CODEGEN: ##load-integer %load-immediate
|
||||
CODEGEN: ##load-tagged %load-immediate
|
||||
CODEGEN: ##load-reference %load-reference
|
||||
CODEGEN: ##load-float %load-float
|
||||
CODEGEN: ##load-double %load-double
|
||||
CODEGEN: ##load-vector %load-vector
|
||||
CODEGEN: ##peek %peek
|
||||
CODEGEN: ##replace %replace
|
||||
CODEGEN: ##replace-imm %replace-imm
|
||||
CODEGEN: ##clear %clear
|
||||
CODEGEN: ##inc %inc
|
||||
CODEGEN: ##call %call
|
||||
CODEGEN: ##jump %jump
|
||||
CODEGEN: ##return %return
|
||||
CODEGEN: ##safepoint %safepoint
|
||||
CODEGEN: ##slot %slot
|
||||
CODEGEN: ##slot-imm %slot-imm
|
||||
CODEGEN: ##set-slot %set-slot
|
||||
CODEGEN: ##set-slot-imm %set-slot-imm
|
||||
CODEGEN: ##add %add
|
||||
CODEGEN: ##add-imm %add-imm
|
||||
CODEGEN: ##sub %sub
|
||||
CODEGEN: ##sub-imm %sub-imm
|
||||
CODEGEN: ##mul %mul
|
||||
CODEGEN: ##mul-imm %mul-imm
|
||||
CODEGEN: ##and %and
|
||||
CODEGEN: ##and-imm %and-imm
|
||||
CODEGEN: ##or %or
|
||||
CODEGEN: ##or-imm %or-imm
|
||||
CODEGEN: ##xor %xor
|
||||
CODEGEN: ##xor-imm %xor-imm
|
||||
CODEGEN: ##shl %shl
|
||||
CODEGEN: ##shl-imm %shl-imm
|
||||
CODEGEN: ##shr %shr
|
||||
CODEGEN: ##shr-imm %shr-imm
|
||||
CODEGEN: ##sar %sar
|
||||
CODEGEN: ##sar-imm %sar-imm
|
||||
CODEGEN: ##min %min
|
||||
CODEGEN: ##max %max
|
||||
CODEGEN: ##not %not
|
||||
CODEGEN: ##neg %neg
|
||||
CODEGEN: ##log2 %log2
|
||||
CODEGEN: ##bit-count %bit-count
|
||||
CODEGEN: ##bit-test %bit-test
|
||||
CODEGEN: ##copy %copy
|
||||
CODEGEN: ##tagged>integer %tagged>integer
|
||||
CODEGEN: ##add-float %add-float
|
||||
CODEGEN: ##sub-float %sub-float
|
||||
CODEGEN: ##mul-float %mul-float
|
||||
CODEGEN: ##div-float %div-float
|
||||
CODEGEN: ##min-float %min-float
|
||||
CODEGEN: ##max-float %max-float
|
||||
CODEGEN: ##sqrt %sqrt
|
||||
CODEGEN: ##single>double-float %single>double-float
|
||||
CODEGEN: ##double>single-float %double>single-float
|
||||
CODEGEN: ##integer>float %integer>float
|
||||
CODEGEN: ##float>integer %float>integer
|
||||
CODEGEN: ##zero-vector %zero-vector
|
||||
CODEGEN: ##fill-vector %fill-vector
|
||||
CODEGEN: ##gather-vector-2 %gather-vector-2
|
||||
CODEGEN: ##gather-vector-4 %gather-vector-4
|
||||
CODEGEN: ##gather-int-vector-2 %gather-int-vector-2
|
||||
CODEGEN: ##gather-int-vector-4 %gather-int-vector-4
|
||||
CODEGEN: ##select-vector %select-vector
|
||||
CODEGEN: ##shuffle-vector-imm %shuffle-vector-imm
|
||||
CODEGEN: ##shuffle-vector-halves-imm %shuffle-vector-halves-imm
|
||||
CODEGEN: ##shuffle-vector %shuffle-vector
|
||||
CODEGEN: ##tail>head-vector %tail>head-vector
|
||||
CODEGEN: ##merge-vector-head %merge-vector-head
|
||||
CODEGEN: ##merge-vector-tail %merge-vector-tail
|
||||
CODEGEN: ##float-pack-vector %float-pack-vector
|
||||
CODEGEN: ##signed-pack-vector %signed-pack-vector
|
||||
CODEGEN: ##unsigned-pack-vector %unsigned-pack-vector
|
||||
CODEGEN: ##unpack-vector-head %unpack-vector-head
|
||||
CODEGEN: ##unpack-vector-tail %unpack-vector-tail
|
||||
CODEGEN: ##integer>float-vector %integer>float-vector
|
||||
CODEGEN: ##float>integer-vector %float>integer-vector
|
||||
CODEGEN: ##compare-vector %compare-vector
|
||||
CODEGEN: ##move-vector-mask %move-vector-mask
|
||||
CODEGEN: ##test-vector %test-vector
|
||||
CODEGEN: ##add-vector %add-vector
|
||||
CODEGEN: ##saturated-add-vector %saturated-add-vector
|
||||
CODEGEN: ##add-sub-vector %add-sub-vector
|
||||
CODEGEN: ##sub-vector %sub-vector
|
||||
CODEGEN: ##saturated-sub-vector %saturated-sub-vector
|
||||
CODEGEN: ##mul-vector %mul-vector
|
||||
CODEGEN: ##mul-high-vector %mul-high-vector
|
||||
CODEGEN: ##mul-horizontal-add-vector %mul-horizontal-add-vector
|
||||
CODEGEN: ##saturated-mul-vector %saturated-mul-vector
|
||||
CODEGEN: ##div-vector %div-vector
|
||||
CODEGEN: ##min-vector %min-vector
|
||||
CODEGEN: ##max-vector %max-vector
|
||||
CODEGEN: ##avg-vector %avg-vector
|
||||
CODEGEN: ##dot-vector %dot-vector
|
||||
CODEGEN: ##sad-vector %sad-vector
|
||||
CODEGEN: ##sqrt-vector %sqrt-vector
|
||||
CODEGEN: ##horizontal-add-vector %horizontal-add-vector
|
||||
CODEGEN: ##horizontal-sub-vector %horizontal-sub-vector
|
||||
CODEGEN: ##horizontal-shl-vector-imm %horizontal-shl-vector-imm
|
||||
CODEGEN: ##horizontal-shr-vector-imm %horizontal-shr-vector-imm
|
||||
CODEGEN: ##abs-vector %abs-vector
|
||||
CODEGEN: ##and-vector %and-vector
|
||||
CODEGEN: ##andn-vector %andn-vector
|
||||
CODEGEN: ##or-vector %or-vector
|
||||
CODEGEN: ##xor-vector %xor-vector
|
||||
CODEGEN: ##not-vector %not-vector
|
||||
CODEGEN: ##shl-vector-imm %shl-vector-imm
|
||||
CODEGEN: ##shr-vector-imm %shr-vector-imm
|
||||
CODEGEN: ##shl-vector %shl-vector
|
||||
CODEGEN: ##shr-vector %shr-vector
|
||||
CODEGEN: ##integer>scalar %integer>scalar
|
||||
CODEGEN: ##scalar>integer %scalar>integer
|
||||
CODEGEN: ##vector>scalar %vector>scalar
|
||||
CODEGEN: ##scalar>vector %scalar>vector
|
||||
CODEGEN: ##box-alien %box-alien
|
||||
CODEGEN: ##box-displaced-alien %box-displaced-alien
|
||||
CODEGEN: ##unbox-alien %unbox-alien
|
||||
CODEGEN: ##unbox-any-c-ptr %unbox-any-c-ptr
|
||||
CODEGEN: ##convert-integer %convert-integer
|
||||
CODEGEN: ##load-memory %load-memory
|
||||
CODEGEN: ##load-memory-imm %load-memory-imm
|
||||
CODEGEN: ##store-memory %store-memory
|
||||
CODEGEN: ##store-memory-imm %store-memory-imm
|
||||
CODEGEN: ##allot %allot
|
||||
CODEGEN: ##write-barrier %write-barrier
|
||||
CODEGEN: ##write-barrier-imm %write-barrier-imm
|
||||
CODEGEN: ##compare %compare
|
||||
CODEGEN: ##compare-imm %compare-imm
|
||||
CODEGEN: ##test %test
|
||||
CODEGEN: ##test-imm %test-imm
|
||||
CODEGEN: ##compare-integer %compare
|
||||
CODEGEN: ##compare-integer-imm %compare-integer-imm
|
||||
CODEGEN: ##compare-float-ordered %compare-float-ordered
|
||||
CODEGEN: ##compare-float-unordered %compare-float-unordered
|
||||
CODEGEN: ##save-context %save-context
|
||||
CODEGEN: ##vm-field %vm-field
|
||||
CODEGEN: ##set-vm-field %set-vm-field
|
||||
CODEGEN: ##alien-global %alien-global
|
||||
CODEGEN: ##call-gc %call-gc
|
||||
CODEGEN: ##spill %spill
|
||||
CODEGEN: ##reload %reload
|
||||
CODEGEN: ##load-integer %load-immediate ;
|
||||
CODEGEN: ##load-tagged %load-immediate ;
|
||||
CODEGEN: ##load-reference %load-reference ;
|
||||
CODEGEN: ##load-float %load-float ;
|
||||
CODEGEN: ##load-double %load-double ;
|
||||
CODEGEN: ##load-vector %load-vector ;
|
||||
CODEGEN: ##peek %peek ;
|
||||
CODEGEN: ##replace %replace ;
|
||||
CODEGEN: ##replace-imm %replace-imm ;
|
||||
CODEGEN: ##clear %clear ;
|
||||
CODEGEN: ##inc %inc ;
|
||||
CODEGEN: ##call %call ;
|
||||
CODEGEN: ##jump %jump ;
|
||||
CODEGEN: ##return %return ;
|
||||
CODEGEN: ##safepoint %safepoint ;
|
||||
CODEGEN: ##slot %slot ;
|
||||
CODEGEN: ##slot-imm %slot-imm ;
|
||||
CODEGEN: ##set-slot %set-slot ;
|
||||
CODEGEN: ##set-slot-imm %set-slot-imm ;
|
||||
CODEGEN: ##add %add ;
|
||||
CODEGEN: ##add-imm %add-imm ;
|
||||
CODEGEN: ##sub %sub ;
|
||||
CODEGEN: ##sub-imm %sub-imm ;
|
||||
CODEGEN: ##mul %mul ;
|
||||
CODEGEN: ##mul-imm %mul-imm ;
|
||||
CODEGEN: ##and %and ;
|
||||
CODEGEN: ##and-imm %and-imm ;
|
||||
CODEGEN: ##or %or ;
|
||||
CODEGEN: ##or-imm %or-imm ;
|
||||
CODEGEN: ##xor %xor ;
|
||||
CODEGEN: ##xor-imm %xor-imm ;
|
||||
CODEGEN: ##shl %shl ;
|
||||
CODEGEN: ##shl-imm %shl-imm ;
|
||||
CODEGEN: ##shr %shr ;
|
||||
CODEGEN: ##shr-imm %shr-imm ;
|
||||
CODEGEN: ##sar %sar ;
|
||||
CODEGEN: ##sar-imm %sar-imm ;
|
||||
CODEGEN: ##min %min ;
|
||||
CODEGEN: ##max %max ;
|
||||
CODEGEN: ##not %not ;
|
||||
CODEGEN: ##neg %neg ;
|
||||
CODEGEN: ##log2 %log2 ;
|
||||
CODEGEN: ##bit-count %bit-count ;
|
||||
CODEGEN: ##bit-test %bit-test ;
|
||||
CODEGEN: ##copy %copy ;
|
||||
CODEGEN: ##tagged>integer %tagged>integer ;
|
||||
CODEGEN: ##add-float %add-float ;
|
||||
CODEGEN: ##sub-float %sub-float ;
|
||||
CODEGEN: ##mul-float %mul-float ;
|
||||
CODEGEN: ##div-float %div-float ;
|
||||
CODEGEN: ##min-float %min-float ;
|
||||
CODEGEN: ##max-float %max-float ;
|
||||
CODEGEN: ##sqrt %sqrt ;
|
||||
CODEGEN: ##single>double-float %single>double-float ;
|
||||
CODEGEN: ##double>single-float %double>single-float ;
|
||||
CODEGEN: ##integer>float %integer>float ;
|
||||
CODEGEN: ##float>integer %float>integer ;
|
||||
CODEGEN: ##zero-vector %zero-vector ;
|
||||
CODEGEN: ##fill-vector %fill-vector ;
|
||||
CODEGEN: ##gather-vector-2 %gather-vector-2 ;
|
||||
CODEGEN: ##gather-vector-4 %gather-vector-4 ;
|
||||
CODEGEN: ##gather-int-vector-2 %gather-int-vector-2 ;
|
||||
CODEGEN: ##gather-int-vector-4 %gather-int-vector-4 ;
|
||||
CODEGEN: ##select-vector %select-vector ;
|
||||
CODEGEN: ##shuffle-vector-imm %shuffle-vector-imm ;
|
||||
CODEGEN: ##shuffle-vector-halves-imm %shuffle-vector-halves-imm ;
|
||||
CODEGEN: ##shuffle-vector %shuffle-vector ;
|
||||
CODEGEN: ##tail>head-vector %tail>head-vector ;
|
||||
CODEGEN: ##merge-vector-head %merge-vector-head ;
|
||||
CODEGEN: ##merge-vector-tail %merge-vector-tail ;
|
||||
CODEGEN: ##float-pack-vector %float-pack-vector ;
|
||||
CODEGEN: ##signed-pack-vector %signed-pack-vector ;
|
||||
CODEGEN: ##unsigned-pack-vector %unsigned-pack-vector ;
|
||||
CODEGEN: ##unpack-vector-head %unpack-vector-head ;
|
||||
CODEGEN: ##unpack-vector-tail %unpack-vector-tail ;
|
||||
CODEGEN: ##integer>float-vector %integer>float-vector ;
|
||||
CODEGEN: ##float>integer-vector %float>integer-vector ;
|
||||
CODEGEN: ##compare-vector %compare-vector ;
|
||||
CODEGEN: ##move-vector-mask %move-vector-mask ;
|
||||
CODEGEN: ##test-vector %test-vector ;
|
||||
CODEGEN: ##add-vector %add-vector ;
|
||||
CODEGEN: ##saturated-add-vector %saturated-add-vector ;
|
||||
CODEGEN: ##add-sub-vector %add-sub-vector ;
|
||||
CODEGEN: ##sub-vector %sub-vector ;
|
||||
CODEGEN: ##saturated-sub-vector %saturated-sub-vector ;
|
||||
CODEGEN: ##mul-vector %mul-vector ;
|
||||
CODEGEN: ##mul-high-vector %mul-high-vector ;
|
||||
CODEGEN: ##mul-horizontal-add-vector %mul-horizontal-add-vector ;
|
||||
CODEGEN: ##saturated-mul-vector %saturated-mul-vector ;
|
||||
CODEGEN: ##div-vector %div-vector ;
|
||||
CODEGEN: ##min-vector %min-vector ;
|
||||
CODEGEN: ##max-vector %max-vector ;
|
||||
CODEGEN: ##avg-vector %avg-vector ;
|
||||
CODEGEN: ##dot-vector %dot-vector ;
|
||||
CODEGEN: ##sad-vector %sad-vector ;
|
||||
CODEGEN: ##sqrt-vector %sqrt-vector ;
|
||||
CODEGEN: ##horizontal-add-vector %horizontal-add-vector ;
|
||||
CODEGEN: ##horizontal-sub-vector %horizontal-sub-vector ;
|
||||
CODEGEN: ##horizontal-shl-vector-imm %horizontal-shl-vector-imm ;
|
||||
CODEGEN: ##horizontal-shr-vector-imm %horizontal-shr-vector-imm ;
|
||||
CODEGEN: ##abs-vector %abs-vector ;
|
||||
CODEGEN: ##and-vector %and-vector ;
|
||||
CODEGEN: ##andn-vector %andn-vector ;
|
||||
CODEGEN: ##or-vector %or-vector ;
|
||||
CODEGEN: ##xor-vector %xor-vector ;
|
||||
CODEGEN: ##not-vector %not-vector ;
|
||||
CODEGEN: ##shl-vector-imm %shl-vector-imm ;
|
||||
CODEGEN: ##shr-vector-imm %shr-vector-imm ;
|
||||
CODEGEN: ##shl-vector %shl-vector ;
|
||||
CODEGEN: ##shr-vector %shr-vector ;
|
||||
CODEGEN: ##integer>scalar %integer>scalar ;
|
||||
CODEGEN: ##scalar>integer %scalar>integer ;
|
||||
CODEGEN: ##vector>scalar %vector>scalar ;
|
||||
CODEGEN: ##scalar>vector %scalar>vector ;
|
||||
CODEGEN: ##box-alien %box-alien ;
|
||||
CODEGEN: ##box-displaced-alien %box-displaced-alien ;
|
||||
CODEGEN: ##unbox-alien %unbox-alien ;
|
||||
CODEGEN: ##unbox-any-c-ptr %unbox-any-c-ptr ;
|
||||
CODEGEN: ##convert-integer %convert-integer ;
|
||||
CODEGEN: ##load-memory %load-memory ;
|
||||
CODEGEN: ##load-memory-imm %load-memory-imm ;
|
||||
CODEGEN: ##store-memory %store-memory ;
|
||||
CODEGEN: ##store-memory-imm %store-memory-imm ;
|
||||
CODEGEN: ##allot %allot ;
|
||||
CODEGEN: ##write-barrier %write-barrier ;
|
||||
CODEGEN: ##write-barrier-imm %write-barrier-imm ;
|
||||
CODEGEN: ##compare %compare ;
|
||||
CODEGEN: ##compare-imm %compare-imm ;
|
||||
CODEGEN: ##test %test ;
|
||||
CODEGEN: ##test-imm %test-imm ;
|
||||
CODEGEN: ##compare-integer %compare ;
|
||||
CODEGEN: ##compare-integer-imm %compare-integer-imm ;
|
||||
CODEGEN: ##compare-float-ordered %compare-float-ordered ;
|
||||
CODEGEN: ##compare-float-unordered %compare-float-unordered ;
|
||||
CODEGEN: ##save-context %save-context ;
|
||||
CODEGEN: ##vm-field %vm-field ;
|
||||
CODEGEN: ##set-vm-field %set-vm-field ;
|
||||
CODEGEN: ##alien-global %alien-global ;
|
||||
CODEGEN: ##call-gc %call-gc ;
|
||||
CODEGEN: ##spill %spill ;
|
||||
CODEGEN: ##reload %reload ;
|
||||
|
||||
! Conditional branches
|
||||
<<
|
||||
|
||||
SYNTAX: CONDITIONAL:
|
||||
scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word
|
||||
SYNTAX: \ CONDITIONAL:
|
||||
scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word ";" expect
|
||||
codegen-method-body define ;
|
||||
|
||||
>>
|
||||
|
||||
CONDITIONAL: ##compare-branch %compare-branch
|
||||
CONDITIONAL: ##compare-imm-branch %compare-imm-branch
|
||||
CONDITIONAL: ##compare-integer-branch %compare-branch
|
||||
CONDITIONAL: ##compare-integer-imm-branch %compare-integer-imm-branch
|
||||
CONDITIONAL: ##test-branch %test-branch
|
||||
CONDITIONAL: ##test-imm-branch %test-imm-branch
|
||||
CONDITIONAL: ##compare-float-ordered-branch %compare-float-ordered-branch
|
||||
CONDITIONAL: ##compare-float-unordered-branch %compare-float-unordered-branch
|
||||
CONDITIONAL: ##test-vector-branch %test-vector-branch
|
||||
CONDITIONAL: ##check-nursery-branch %check-nursery-branch
|
||||
CONDITIONAL: ##fixnum-add %fixnum-add
|
||||
CONDITIONAL: ##fixnum-sub %fixnum-sub
|
||||
CONDITIONAL: ##fixnum-mul %fixnum-mul
|
||||
CONDITIONAL: ##compare-branch %compare-branch ;
|
||||
CONDITIONAL: ##compare-imm-branch %compare-imm-branch ;
|
||||
CONDITIONAL: ##compare-integer-branch %compare-branch ;
|
||||
CONDITIONAL: ##compare-integer-imm-branch %compare-integer-imm-branch ;
|
||||
CONDITIONAL: ##test-branch %test-branch ;
|
||||
CONDITIONAL: ##test-imm-branch %test-imm-branch ;
|
||||
CONDITIONAL: ##compare-float-ordered-branch %compare-float-ordered-branch ;
|
||||
CONDITIONAL: ##compare-float-unordered-branch %compare-float-unordered-branch ;
|
||||
CONDITIONAL: ##test-vector-branch %test-vector-branch ;
|
||||
CONDITIONAL: ##check-nursery-branch %check-nursery-branch ;
|
||||
CONDITIONAL: ##fixnum-add %fixnum-add ;
|
||||
CONDITIONAL: ##fixnum-sub %fixnum-sub ;
|
||||
CONDITIONAL: ##fixnum-mul %fixnum-mul ;
|
||||
|
||||
! FFI
|
||||
CODEGEN: ##unbox %unbox
|
||||
CODEGEN: ##unbox-long-long %unbox-long-long
|
||||
CODEGEN: ##local-allot %local-allot
|
||||
CODEGEN: ##box %box
|
||||
CODEGEN: ##box-long-long %box-long-long
|
||||
CODEGEN: ##alien-invoke %alien-invoke
|
||||
CODEGEN: ##alien-indirect %alien-indirect
|
||||
CODEGEN: ##alien-assembly %alien-assembly
|
||||
CODEGEN: ##callback-inputs %callback-inputs
|
||||
CODEGEN: ##callback-outputs %callback-outputs
|
||||
CODEGEN: ##unbox %unbox ;
|
||||
CODEGEN: ##unbox-long-long %unbox-long-long ;
|
||||
CODEGEN: ##local-allot %local-allot ;
|
||||
CODEGEN: ##box %box ;
|
||||
CODEGEN: ##box-long-long %box-long-long ;
|
||||
CODEGEN: ##alien-invoke %alien-invoke ;
|
||||
CODEGEN: ##alien-indirect %alien-indirect ;
|
||||
CODEGEN: ##alien-assembly %alien-assembly ;
|
||||
CODEGEN: ##callback-inputs %callback-inputs ;
|
||||
CODEGEN: ##callback-outputs %callback-outputs ;
|
||||
|
|
|
@ -1381,13 +1381,13 @@ symbol: last-opcode
|
|||
dup last-instruction set-global
|
||||
] dip ( cpu -- ) define-declared ;
|
||||
|
||||
SYNTAX: INSTRUCTION: ";" parse-tokens parse-instructions ;
|
||||
SYNTAX: \ INSTRUCTION: ";" parse-tokens parse-instructions ;
|
||||
|
||||
SYNTAX: cycles:
|
||||
SYNTAX: \ cycles:
|
||||
! Set the number of cycles for the last instruction that was defined.
|
||||
scan-token string>number last-opcode get-global instruction-cycles set-nth ;
|
||||
|
||||
SYNTAX: opcode:
|
||||
SYNTAX: \ opcode:
|
||||
! Set the opcode number for the last instruction that was defined.
|
||||
last-instruction get-global 1quotation scan-token hex>
|
||||
dup last-opcode set-global set-instruction ;
|
||||
|
|
|
@ -22,8 +22,8 @@ registers [ H{ } clone ] initialize
|
|||
: define-registers ( names size -- )
|
||||
[ [ 0 ] dip (define-registers) ] keep registers get set-at ;
|
||||
|
||||
SYNTAX: REGISTERS:
|
||||
SYNTAX: \ REGISTERS:
|
||||
scan-number [ ";" parse-tokens ] dip define-registers ;
|
||||
|
||||
SYNTAX: HI-REGISTERS:
|
||||
SYNTAX: \ HI-REGISTERS:
|
||||
scan-number [ ";" parse-tokens 4 ] dip (define-registers) drop ;
|
||||
|
|
|
@ -24,7 +24,7 @@ icons [ H{ } clone ] initialize
|
|||
define
|
||||
] 2bi ;
|
||||
|
||||
SYNTAX: ICON: scan-word scan-token ";" expect define-icon ;
|
||||
SYNTAX: \ ICON: scan-word scan-token ";" expect define-icon ;
|
||||
|
||||
>>
|
||||
|
||||
|
|
|
@ -63,6 +63,6 @@ symbol: euc-table
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: EUC:
|
||||
SYNTAX: \ EUC:
|
||||
! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt" ;
|
||||
scan-new-class scan-object ";" expect define-euc ;
|
||||
|
|
|
@ -537,18 +537,18 @@ ERROR: could-not-parse-ebnf ;
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: <EBNF
|
||||
SYNTAX: \ EBNF<
|
||||
"EBNF>"
|
||||
reset-tokenizer parse-multiline-string parse-ebnf main of
|
||||
suffix! reset-tokenizer ;
|
||||
|
||||
SYNTAX: [EBNF
|
||||
SYNTAX: \ EBNF[
|
||||
"EBNF]"
|
||||
reset-tokenizer parse-multiline-string ebnf>quot nip
|
||||
suffix! \ call suffix! reset-tokenizer ;
|
||||
|
||||
SYNTAX: EBNF:
|
||||
reset-tokenizer scan-new-word dup ";EBNF" parse-multiline-string
|
||||
SYNTAX: \ EBNF:
|
||||
reset-tokenizer scan-new-word dup "EBNF;" parse-multiline-string
|
||||
ebnf>quot swapd
|
||||
( input -- ast ) define-declared "ebnf-parser" set-word-prop
|
||||
reset-tokenizer ;
|
||||
|
|
|
@ -14,7 +14,7 @@ GENERIC: variable-setter ( word -- word' ) ;
|
|||
M: variable variable-setter "variable-setter" word-prop ;
|
||||
M: local-reader variable-setter "local-writer" word-prop ;
|
||||
|
||||
SYNTAX: set:
|
||||
SYNTAX: \ set:
|
||||
scan-object variable-setter suffix! ;
|
||||
|
||||
: [variable-getter] ( variable -- quot )
|
||||
|
@ -34,10 +34,10 @@ SYNTAX: set:
|
|||
: define-variable ( word -- )
|
||||
dup [ [variable-getter] ] [ [variable-setter] ] bi (define-variable) ;
|
||||
|
||||
SYNTAX: VAR:
|
||||
SYNTAX: \ var:
|
||||
scan-new-word define-variable ;
|
||||
|
||||
M: variable definer drop \ VAR: f ;
|
||||
M: variable definer drop \ var: f ;
|
||||
M: variable definition drop f ;
|
||||
M: variable link-effect? drop f ;
|
||||
M: variable print-stack-effect? drop f ;
|
||||
|
@ -58,8 +58,8 @@ PREDICATE: typed-variable < variable
|
|||
[ initial-value drop swap set-global ]
|
||||
} 2cleave (define-variable) ;
|
||||
|
||||
SYNTAX: TYPED-VAR:
|
||||
scan-new-word scan-object define-typed-variable ;
|
||||
SYNTAX: \ TYPED-VAR:
|
||||
scan-new-word scan-object ";" expect define-typed-variable ;
|
||||
|
||||
M: typed-variable definer drop \ TYPED-VAR: f ;
|
||||
M: typed-variable definition "variable-type" word-prop 1quotation ;
|
||||
|
@ -77,10 +77,10 @@ PREDICATE: global-variable < variable
|
|||
: define-global ( word -- )
|
||||
global-box new [ [global-getter] ] [ [global-setter] ] bi (define-variable) ;
|
||||
|
||||
SYNTAX: GLOBAL:
|
||||
SYNTAX: \ global:
|
||||
scan-new-word define-global ;
|
||||
|
||||
M: global-variable definer drop \ GLOBAL: f ;
|
||||
M: global-variable definer drop \ global: f ;
|
||||
|
||||
INTERSECTION: typed-global-variable
|
||||
global-variable typed-variable ;
|
||||
|
@ -91,7 +91,7 @@ INTERSECTION: typed-global-variable
|
|||
[ [ [global-getter] ] dip [typed-getter] ]
|
||||
[ [ [global-setter] ] dip [typed-setter] ] 2bi (define-variable) ;
|
||||
|
||||
SYNTAX: TYPED-GLOBAL:
|
||||
scan-new-word scan-object define-typed-global ;
|
||||
SYNTAX: \ TYPED-GLOBAL:
|
||||
scan-new-word scan-object ";" expect define-typed-global ;
|
||||
|
||||
M: typed-global-variable definer drop \ TYPED-GLOBAL: f ;
|
||||
|
|
|
@ -42,12 +42,12 @@ M: variant-class initial-value*
|
|||
[ scan-token dup ";" = not ]
|
||||
[ parse-variant-member ] produce nip ;
|
||||
|
||||
SYNTAX: VARIANT:
|
||||
SYNTAX: \ VARIANT:
|
||||
scan-new-class
|
||||
parse-variant-members
|
||||
define-variant-class-members ;
|
||||
|
||||
SYNTAX: VARIANT-MEMBER:
|
||||
SYNTAX: \ VARIANT-MEMBER:
|
||||
scan-word
|
||||
scan-token parse-variant-member
|
||||
define-variant-class-member ";" expect ;
|
||||
|
|
|
@ -64,13 +64,13 @@ VALUE: rotation-step
|
|||
3 \ translation-step set-value
|
||||
5 \ rotation-step set-value
|
||||
|
||||
VAR: selected-file-model
|
||||
VAR: observer3d
|
||||
VAR: view1
|
||||
VAR: view2
|
||||
VAR: view3
|
||||
VAR: view4
|
||||
VAR: present-space
|
||||
var: selected-file-model
|
||||
var: observer3d
|
||||
var: view1
|
||||
var: view2
|
||||
var: view3
|
||||
var: view4
|
||||
var: present-space
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ $nl
|
|||
{
|
||||
$unchecked-example
|
||||
|
||||
"VAR: my-camera"
|
||||
"var: my-camera"
|
||||
": init-my-camera ( -- )"
|
||||
" <turtle> >my-camera"
|
||||
" [ my-camera> >self"
|
||||
|
|
|
@ -5,7 +5,7 @@ in: 4DNav.turtle
|
|||
|
||||
! replacement of self
|
||||
|
||||
VAR: self
|
||||
var: self
|
||||
|
||||
: with-self ( quot obj -- ) [ >self call ] with-scope ; inline
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ tools.walker
|
|||
|
||||
in: adsoda
|
||||
|
||||
DEFER: combinations
|
||||
VAR: pv
|
||||
defer: combinations
|
||||
var: pv
|
||||
|
||||
|
||||
! -------------------------------------------------------------
|
||||
|
|
|
@ -8,7 +8,7 @@ in: automata
|
|||
! set-rule
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: rule VAR: rule-number
|
||||
var: rule var: rule-number
|
||||
|
||||
: init-rule ( -- ) 8 <hashtable> >rule ;
|
||||
|
||||
|
@ -70,9 +70,9 @@ VARS: width height ;
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: bitmap
|
||||
var: bitmap
|
||||
|
||||
VAR: last-line
|
||||
var: last-line
|
||||
|
||||
: run-rule ( -- )
|
||||
last-line> height> [ drop step-capped-line dup ] map >bitmap >last-line ;
|
||||
|
@ -85,7 +85,7 @@ VAR: last-line
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! VAR: loop-flag
|
||||
! var: loop-flag
|
||||
|
||||
! DEFER: loop
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ in: automata.ui
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: slate
|
||||
var: slate
|
||||
|
||||
! Call a 'model' quotation with the current 'view'.
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ SELF-SLOTS: hsva
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: color-stack
|
||||
var: color-stack
|
||||
|
||||
: init-color-stack ( -- ) V{ } clone >color-stack ;
|
||||
|
||||
|
@ -62,7 +62,7 @@ VAR: color-stack
|
|||
|
||||
: check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map supremum ;
|
||||
|
||||
VAR: threshold
|
||||
var: threshold
|
||||
|
||||
: iterate? ( -- ? ) get-modelview-matrix check-size threshold> > ;
|
||||
|
||||
|
@ -162,7 +162,7 @@ MACRO: rule ( seq -- quot ) [rule] ;
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: background
|
||||
var: background
|
||||
|
||||
: set-initial-background ( -- ) T{ hsva f 0 0 1 1 } clone >self ;
|
||||
|
||||
|
@ -175,9 +175,9 @@ VAR: background
|
|||
|
||||
USING: rewrite-closures ;
|
||||
|
||||
VAR: viewport ! { left width bottom height }
|
||||
var: viewport ! { left width bottom height }
|
||||
|
||||
VAR: start-shape
|
||||
var: start-shape
|
||||
|
||||
: set-initial-color ( -- ) T{ hsva f 0 0 0 1 } clone >self ;
|
||||
|
||||
|
|
|
@ -13,16 +13,16 @@ in: springies
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: nodes
|
||||
VAR: springs
|
||||
VAR: time-slice
|
||||
VAR: world-size
|
||||
var: nodes
|
||||
var: springs
|
||||
var: time-slice
|
||||
var: world-size
|
||||
|
||||
: world-width ( -- width ) world-size> first ;
|
||||
|
||||
: world-height ( -- height ) world-size> second ;
|
||||
|
||||
VAR: gravity
|
||||
var: gravity
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! node
|
||||
|
|
|
@ -29,9 +29,9 @@ in: springies.ui
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
VAR: slate
|
||||
var: slate
|
||||
|
||||
VAR: loop
|
||||
var: loop
|
||||
|
||||
: update-world-size ( -- ) slate> rect-dim >world-size ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue