update existing code to use :> ( ) when possible

db4
Joe Groff 2009-10-28 16:11:33 -05:00
parent c19912241b
commit 6e1bffb1c5
29 changed files with 60 additions and 64 deletions

View File

@ -333,7 +333,7 @@ M: character-type (<fortran-result>)
] if-empty ; ] if-empty ;
:: [fortran-invoke] ( [args>args] return library function parameters -- [args>args] quot ) :: [fortran-invoke] ( [args>args] return library function parameters -- [args>args] quot )
return parameters fortran-sig>c-sig :> c-parameters :> c-return return parameters fortran-sig>c-sig :> ( c-return c-parameters )
function fortran-name>symbol-name :> c-function function fortran-name>symbol-name :> c-function
[args>args] [args>args]
c-return library c-function c-parameters \ alien-invoke c-return library c-function c-parameters \ alien-invoke

View File

@ -98,7 +98,7 @@ IN: alien.parser
type-name current-vocab create :> type-word type-name current-vocab create :> type-word
type-word [ reset-generic ] [ reset-c-type ] bi type-word [ reset-generic ] [ reset-c-type ] bi
void* type-word typedef void* type-word typedef
parameters return parse-arglist :> callback-effect :> types parameters return parse-arglist :> ( types callback-effect )
type-word callback-effect "callback-effect" set-word-prop type-word callback-effect "callback-effect" set-word-prop
type-word lib "callback-library" set-word-prop type-word lib "callback-library" set-word-prop
type-word return types lib library-abi callback-quot (( quot -- alien )) ; type-word return types lib library-abi callback-quot (( quot -- alien )) ;

View File

@ -113,7 +113,7 @@ PRIVATE>
M:: lsb0-bit-writer poke ( value n bs -- ) M:: lsb0-bit-writer poke ( value n bs -- )
value n <widthed> :> widthed value n <widthed> :> widthed
widthed widthed
bs widthed>> #bits>> 8 swap - split-widthed :> remainder :> byte bs widthed>> #bits>> 8 swap - split-widthed :> ( byte remainder )
byte bs widthed>> |widthed :> new-byte byte bs widthed>> |widthed :> new-byte
new-byte #bits>> 8 = [ new-byte #bits>> 8 = [
new-byte bits>> bs bytes>> push new-byte bits>> bs bytes>> push
@ -143,7 +143,7 @@ ERROR: not-enough-bits n bit-reader ;
neg shift n bits ; neg shift n bits ;
:: adjust-bits ( n bs -- ) :: adjust-bits ( n bs -- )
n 8 /mod :> #bits :> #bytes n 8 /mod :> ( #bytes #bits )
bs [ #bytes + ] change-byte-pos bs [ #bytes + ] change-byte-pos
bit-pos>> #bits + dup 8 >= [ bit-pos>> #bits + dup 8 >= [
8 - bs (>>bit-pos) 8 - bs (>>bit-pos)

View File

@ -119,16 +119,16 @@ GENERIC: easter ( obj -- obj' )
:: easter-month-day ( year -- month day ) :: easter-month-day ( year -- month day )
year 19 mod :> a year 19 mod :> a
year 100 /mod :> c :> b year 100 /mod :> ( b c )
b 4 /mod :> e :> d b 4 /mod :> ( d e )
b 8 + 25 /i :> f b 8 + 25 /i :> f
b f - 1 + 3 /i :> g b f - 1 + 3 /i :> g
19 a * b + d - g - 15 + 30 mod :> h 19 a * b + d - g - 15 + 30 mod :> h
c 4 /mod :> k :> i c 4 /mod :> ( i k )
32 2 e * + 2 i * + h - k - 7 mod :> l 32 2 e * + 2 i * + h - k - 7 mod :> l
a 11 h * + 22 l * + 451 /i :> m a 11 h * + 22 l * + 451 /i :> m
h l + 7 m * - 114 + 31 /mod 1 + :> day :> month h l + 7 m * - 114 + 31 /mod 1 + :> ( month day )
month day ; month day ;
M: integer easter ( year -- timestamp ) M: integer easter ( year -- timestamp )

View File

@ -24,7 +24,7 @@ PRIVATE>
:: hmac-stream ( stream key checksum -- value ) :: hmac-stream ( stream key checksum -- value )
checksum initialize-checksum-state :> checksum-state checksum initialize-checksum-state :> checksum-state
checksum key checksum-state init-key :> Ki :> Ko checksum key checksum-state init-key :> ( Ko Ki )
checksum-state Ki add-checksum-bytes checksum-state Ki add-checksum-bytes
stream add-checksum-stream get-checksum stream add-checksum-stream get-checksum
checksum initialize-checksum-state checksum initialize-checksum-state

View File

@ -10,7 +10,7 @@ IN: classes.struct.bit-accessors
[ 2^ 1 - ] bi@ swap bitnot bitand ; [ 2^ 1 - ] bi@ swap bitnot bitand ;
:: manipulate-bits ( offset bits step-quot -- quot shift-amount offset' bits' ) :: manipulate-bits ( offset bits step-quot -- quot shift-amount offset' bits' )
offset 8 /mod :> start-bit :> i offset 8 /mod :> ( i start-bit )
start-bit bits + 8 min :> end-bit start-bit bits + 8 min :> end-bit
start-bit end-bit ones-between :> mask start-bit end-bit ones-between :> mask
end-bit start-bit - :> used-bits end-bit start-bit - :> used-bits

View File

@ -156,18 +156,18 @@ MACRO: if-literals-match ( quots -- )
[ [ ^^fill-vector ] [ ^^xor-vector ] bi ] if ; [ [ ^^fill-vector ] [ ^^xor-vector ] bi ] if ;
:: ((generate-compare-vector)) ( src1 src2 rep {cc,swap} -- dst ) :: ((generate-compare-vector)) ( src1 src2 rep {cc,swap} -- dst )
{cc,swap} first2 :> swap? :> cc {cc,swap} first2 :> ( cc swap? )
swap? swap?
[ src2 src1 rep cc ^^compare-vector ] [ src2 src1 rep cc ^^compare-vector ]
[ src1 src2 rep cc ^^compare-vector ] if ; [ src1 src2 rep cc ^^compare-vector ] if ;
:: (generate-compare-vector) ( src1 src2 rep orig-cc -- dst ) :: (generate-compare-vector) ( src1 src2 rep orig-cc -- dst )
rep orig-cc %compare-vector-ccs :> not? :> ccs rep orig-cc %compare-vector-ccs :> ( ccs not? )
ccs empty? ccs empty?
[ rep not? [ ^^fill-vector ] [ ^^zero-vector ] if ] [ rep not? [ ^^fill-vector ] [ ^^zero-vector ] if ]
[ [
ccs unclip :> first-cc :> rest-ccs ccs unclip :> ( rest-ccs first-cc )
src1 src2 rep first-cc ((generate-compare-vector)) :> first-dst src1 src2 rep first-cc ((generate-compare-vector)) :> first-dst
rest-ccs first-dst rest-ccs first-dst

View File

@ -42,7 +42,7 @@ IN: compiler.cfg.intrinsics.slots
first class>> immediate class<= not ; first class>> immediate class<= not ;
:: (emit-set-slot) ( infos -- ) :: (emit-set-slot) ( infos -- )
3inputs :> slot :> obj :> src 3inputs :> ( src obj slot )
slot infos second value-tag ^^tag-offset>slot :> slot slot infos second value-tag ^^tag-offset>slot :> slot
@ -54,7 +54,7 @@ IN: compiler.cfg.intrinsics.slots
:: (emit-set-slot-imm) ( infos -- ) :: (emit-set-slot-imm) ( infos -- )
ds-drop ds-drop
2inputs :> obj :> src 2inputs :> ( src obj )
infos third literal>> :> slot infos third literal>> :> slot
infos second value-tag :> tag infos second value-tag :> tag

View File

@ -504,11 +504,11 @@ M: ppc %compare [ (%compare) ] 2dip %boolean ;
M: ppc %compare-imm [ (%compare-imm) ] 2dip %boolean ; M: ppc %compare-imm [ (%compare-imm) ] 2dip %boolean ;
M:: ppc %compare-float-ordered ( dst src1 src2 cc temp -- ) M:: ppc %compare-float-ordered ( dst src1 src2 cc temp -- )
src1 src2 cc negate-cc \ (%compare-float-ordered) (%compare-float) :> branch2 :> branch1 src1 src2 cc negate-cc \ (%compare-float-ordered) (%compare-float) :> ( branch1 branch2 )
dst temp branch1 branch2 (%boolean) ; dst temp branch1 branch2 (%boolean) ;
M:: ppc %compare-float-unordered ( dst src1 src2 cc temp -- ) M:: ppc %compare-float-unordered ( dst src1 src2 cc temp -- )
src1 src2 cc negate-cc \ (%compare-float-unordered) (%compare-float) :> branch2 :> branch1 src1 src2 cc negate-cc \ (%compare-float-unordered) (%compare-float) :> ( branch1 branch2 )
dst temp branch1 branch2 (%boolean) ; dst temp branch1 branch2 (%boolean) ;
:: %branch ( label cc -- ) :: %branch ( label cc -- )
@ -534,11 +534,11 @@ M:: ppc %compare-imm-branch ( label src1 src2 cc -- )
branch2 [ label branch2 execute( label -- ) ] when ; inline branch2 [ label branch2 execute( label -- ) ] when ; inline
M:: ppc %compare-float-ordered-branch ( label src1 src2 cc -- ) M:: ppc %compare-float-ordered-branch ( label src1 src2 cc -- )
src1 src2 cc \ (%compare-float-ordered) (%compare-float) :> branch2 :> branch1 src1 src2 cc \ (%compare-float-ordered) (%compare-float) :> ( branch1 branch2 )
label branch1 branch2 (%branch) ; label branch1 branch2 (%branch) ;
M:: ppc %compare-float-unordered-branch ( label src1 src2 cc -- ) M:: ppc %compare-float-unordered-branch ( label src1 src2 cc -- )
src1 src2 cc \ (%compare-float-unordered) (%compare-float) :> branch2 :> branch1 src1 src2 cc \ (%compare-float-unordered) (%compare-float) :> ( branch1 branch2 )
label branch1 branch2 (%branch) ; label branch1 branch2 (%branch) ;
: load-from-frame ( dst n rep -- ) : load-from-frame ( dst n rep -- )

View File

@ -114,8 +114,8 @@ DEFER: (parse-paragraph)
:: (take-until) ( state delimiter accum -- string/f state' ) :: (take-until) ( state delimiter accum -- string/f state' )
state empty? [ accum "\n" join f ] [ state empty? [ accum "\n" join f ] [
state unclip-slice :> first :> rest state unclip-slice :> ( rest first )
first delimiter split1 :> after :> before first delimiter split1 :> ( before after )
before accum push before accum push
after [ after [
accum "\n" join accum "\n" join

View File

@ -120,7 +120,7 @@ CONSTANT: packet-size 65536
[ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook [ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook
:: do-receive ( port -- packet sockaddr ) :: do-receive ( port -- packet sockaddr )
port addr>> empty-sockaddr/size :> len :> sockaddr port addr>> empty-sockaddr/size :> ( sockaddr len )
port handle>> handle-fd ! s port handle>> handle-fd ! s
receive-buffer get-global ! buf receive-buffer get-global ! buf
packet-size ! nbytes packet-size ! nbytes

View File

@ -16,7 +16,7 @@ IN: math.matrices
:: rotation-matrix3 ( axis theta -- matrix ) :: rotation-matrix3 ( axis theta -- matrix )
theta cos :> c theta cos :> c
theta sin :> s theta sin :> s
axis first3 :> z :> y :> x axis first3 :> ( x y z )
x sq 1.0 x sq - c * + x y * 1.0 c - * z s * - x z * 1.0 c - * y s * + 3array x sq 1.0 x sq - c * + x y * 1.0 c - * z s * - x z * 1.0 c - * y s * + 3array
x y * 1.0 c - * z s * + y sq 1.0 y sq - c * + y z * 1.0 c - * x s * - 3array x y * 1.0 c - * z s * + y sq 1.0 y sq - c * + y z * 1.0 c - * x s * - 3array
x z * 1.0 c - * y s * - y z * 1.0 c - * x s * + z sq 1.0 z sq - c * + 3array x z * 1.0 c - * y s * - y z * 1.0 c - * x s * + z sq 1.0 z sq - c * + 3array
@ -25,14 +25,14 @@ IN: math.matrices
:: rotation-matrix4 ( axis theta -- matrix ) :: rotation-matrix4 ( axis theta -- matrix )
theta cos :> c theta cos :> c
theta sin :> s theta sin :> s
axis first3 :> z :> y :> x axis first3 :> ( x y z )
x sq 1.0 x sq - c * + x y * 1.0 c - * z s * - x z * 1.0 c - * y s * + 0 4array x sq 1.0 x sq - c * + x y * 1.0 c - * z s * - x z * 1.0 c - * y s * + 0 4array
x y * 1.0 c - * z s * + y sq 1.0 y sq - c * + y z * 1.0 c - * x s * - 0 4array x y * 1.0 c - * z s * + y sq 1.0 y sq - c * + y z * 1.0 c - * x s * - 0 4array
x z * 1.0 c - * y s * - y z * 1.0 c - * x s * + z sq 1.0 z sq - c * + 0 4array x z * 1.0 c - * y s * - y z * 1.0 c - * x s * + z sq 1.0 z sq - c * + 0 4array
{ 0.0 0.0 0.0 1.0 } 4array ; { 0.0 0.0 0.0 1.0 } 4array ;
:: translation-matrix4 ( offset -- matrix ) :: translation-matrix4 ( offset -- matrix )
offset first3 :> z :> y :> x offset first3 :> ( x y z )
{ {
{ 1.0 0.0 0.0 x } { 1.0 0.0 0.0 x }
{ 0.0 1.0 0.0 y } { 0.0 1.0 0.0 y }
@ -44,7 +44,7 @@ IN: math.matrices
dup number? [ dup dup ] [ first3 ] if ; dup number? [ dup dup ] [ first3 ] if ;
:: scale-matrix3 ( factors -- matrix ) :: scale-matrix3 ( factors -- matrix )
factors >scale-factors :> z :> y :> x factors >scale-factors :> ( x y z )
{ {
{ x 0.0 0.0 } { x 0.0 0.0 }
{ 0.0 y 0.0 } { 0.0 y 0.0 }
@ -52,7 +52,7 @@ IN: math.matrices
} ; } ;
:: scale-matrix4 ( factors -- matrix ) :: scale-matrix4 ( factors -- matrix )
factors >scale-factors :> z :> y :> x factors >scale-factors :> ( x y z )
{ {
{ x 0.0 0.0 0.0 } { x 0.0 0.0 0.0 }
{ 0.0 y 0.0 0.0 } { 0.0 y 0.0 0.0 }
@ -64,7 +64,7 @@ IN: math.matrices
[ recip ] map scale-matrix4 ; [ recip ] map scale-matrix4 ;
:: frustum-matrix4 ( xy-dim near far -- matrix ) :: frustum-matrix4 ( xy-dim near far -- matrix )
xy-dim first2 :> y :> x xy-dim first2 :> ( x y )
near x /f :> xf near x /f :> xf
near y /f :> yf near y /f :> yf
near far + near far - /f :> zf near far + near far - /f :> zf

View File

@ -8,7 +8,7 @@ IN: math.primes.miller-rabin
:: (miller-rabin) ( n trials -- ? ) :: (miller-rabin) ( n trials -- ? )
n 1 - :> n-1 n 1 - :> n-1
n-1 factor-2s :> s :> r n-1 factor-2s :> ( r s )
0 :> a! 0 :> a!
trials [ trials [
drop drop

View File

@ -81,8 +81,8 @@ ERROR: bad-vconvert-input value expected-type ;
PRIVATE> PRIVATE>
MACRO:: vconvert ( from-type to-type -- ) MACRO:: vconvert ( from-type to-type -- )
from-type new [ element-type ] [ byte-length ] bi :> from-length :> from-element from-type new [ element-type ] [ byte-length ] bi :> ( from-element from-length )
to-type new [ element-type ] [ byte-length ] bi :> to-length :> to-element to-type new [ element-type ] [ byte-length ] bi :> ( to-element to-length )
from-element heap-size :> from-size from-element heap-size :> from-size
to-element heap-size :> to-size to-element heap-size :> to-size

View File

@ -391,8 +391,8 @@ TUPLE: inconsistent-vector-test bool branch ;
2dup = [ drop ] [ inconsistent-vector-test boa ] if ; 2dup = [ drop ] [ inconsistent-vector-test boa ] if ;
:: test-vector-tests ( vector decl -- none? any? all? ) :: test-vector-tests ( vector decl -- none? any? all? )
vector decl test-vector-tests-bool :> bool-all :> bool-any :> bool-none vector decl test-vector-tests-bool :> ( bool-none bool-any bool-all )
vector decl test-vector-tests-branch :> branch-all :> branch-any :> branch-none vector decl test-vector-tests-branch :> ( branch-none branch-any branch-all )
bool-none branch-none ?inconsistent bool-none branch-none ?inconsistent
bool-any branch-any ?inconsistent bool-any branch-any ?inconsistent

View File

@ -95,8 +95,8 @@ MACRO: all-enabled-client-state ( seq quot -- )
#! We use GL_LINE_STRIP with a duplicated first vertex #! We use GL_LINE_STRIP with a duplicated first vertex
#! instead of GL_LINE_LOOP to work around a bug in Apple's #! instead of GL_LINE_LOOP to work around a bug in Apple's
#! X3100 driver. #! X3100 driver.
loc first2 :> y :> x loc first2 :> ( x y )
dim first2 :> h :> w dim first2 :> ( w h )
[ [
x 0.5 + y 0.5 + x 0.5 + y 0.5 +
x w + 0.3 - y 0.5 + x w + 0.3 - y 0.5 +
@ -115,8 +115,8 @@ MACRO: all-enabled-client-state ( seq quot -- )
rect-vertices (gl-rect) ; rect-vertices (gl-rect) ;
:: (fill-rect-vertices) ( loc dim -- vertices ) :: (fill-rect-vertices) ( loc dim -- vertices )
loc first2 :> y :> x loc first2 :> ( x y )
dim first2 :> h :> w dim first2 :> ( w h )
[ [
x y x y
x w + y x w + y

View File

@ -278,7 +278,7 @@ TUPLE: single-texture < disposable image dim loc texture-coords texture display-
] unless ; ] unless ;
:: tex-image ( image bitmap -- ) :: tex-image ( image bitmap -- )
image image-format :> type :> format :> internal-format image image-format :> ( internal-format format type )
GL_TEXTURE_2D 0 internal-format GL_TEXTURE_2D 0 internal-format
image dim>> adjust-texture-dim first2 0 image dim>> adjust-texture-dim first2 0
format type bitmap glTexImage2D ; format type bitmap glTexImage2D ;

View File

@ -614,7 +614,7 @@ ERROR: parse-failed input word ;
SYNTAX: PEG: SYNTAX: PEG:
[let [let
(:) :> effect :> def :> word (:) :> ( word def effect )
[ [
[ [
def call compile :> compiled-def def call compile :> compiled-def

View File

@ -36,7 +36,7 @@ M:: bitmap-node (new-at) ( shift value key hashcode bitmap-node -- node' added-l
new-leaf new-leaf
] [ ] [
idx nodes nth :> n idx nodes nth :> n
shift radix-bits + value key hashcode n (new-at) :> new-leaf :> n' shift radix-bits + value key hashcode n (new-at) :> ( n' new-leaf )
n n' eq? [ n n' eq? [
bitmap-node bitmap-node
] [ ] [

View File

@ -26,7 +26,7 @@ M:: collision-node (pluck-at) ( key hashcode collision-node -- leaf-node )
M:: collision-node (new-at) ( shift value key hashcode collision-node -- node' added-leaf ) M:: collision-node (new-at) ( shift value key hashcode collision-node -- node' added-leaf )
hashcode collision-node hashcode>> eq? [ hashcode collision-node hashcode>> eq? [
key hashcode collision-node find-index :> leaf-node :> idx key hashcode collision-node find-index :> ( idx leaf-node )
idx [ idx [
value leaf-node value>> = [ value leaf-node value>> = [
collision-node f collision-node f

View File

@ -12,7 +12,7 @@ M:: full-node (new-at) ( shift value key hashcode full-node -- node' added-leaf
hashcode full-node shift>> mask :> idx hashcode full-node shift>> mask :> idx
idx nodes nth-unsafe :> n idx nodes nth-unsafe :> n
shift radix-bits + value key hashcode n (new-at) :> new-leaf :> n' shift radix-bits + value key hashcode n (new-at) :> ( n' new-leaf )
n n' eq? [ n n' eq? [
full-node full-node
] [ ] [

View File

@ -46,7 +46,7 @@ GENERIC: nfa-node ( node -- start-state end-state )
epsilon nfa-table get add-transition ; epsilon nfa-table get add-transition ;
M:: star nfa-node ( node -- start end ) M:: star nfa-node ( node -- start end )
node term>> nfa-node :> s1 :> s0 node term>> nfa-node :> ( s0 s1 )
next-state :> s2 next-state :> s2
next-state :> s3 next-state :> s3
s1 s0 epsilon-transition s1 s0 epsilon-transition

View File

@ -78,7 +78,8 @@ CONSTANT: homo-sapiens
: write-repeat-fasta ( n alu desc id -- ) : write-repeat-fasta ( n alu desc id -- )
write-description write-description
[let [let
0 :> k! :> alu :> alu
0 :> k!
[| len | k len alu make-repeat-fasta k! ] split-lines [| len | k len alu make-repeat-fasta k! ] split-lines
] ; inline ] ; inline
@ -86,12 +87,7 @@ CONSTANT: homo-sapiens
homo-sapiens make-cumulative homo-sapiens make-cumulative
IUB make-cumulative IUB make-cumulative
[let [let
:> homo-sapiens-floats :> ( n out IUB-chars IUB-floats homo-sapiens-chars homo-sapiens-floats )
:> homo-sapiens-chars
:> IUB-floats
:> IUB-chars
:> out
:> n
initial-seed :> seed initial-seed :> seed
out ascii [ out ascii [

View File

@ -75,8 +75,8 @@ M: decimal before?
:: D/ ( D1 D2 a -- D3 ) :: D/ ( D1 D2 a -- D3 )
D1 D2 guard-decimals 2drop D1 D2 guard-decimals 2drop
D1 >decimal< :> e1 :> m1 D1 >decimal< :> ( m1 e1 )
D2 >decimal< :> e2 :> m2 D2 >decimal< :> ( m2 e2 )
m1 a 10^ * m1 a 10^ *
m2 /i m2 /i

View File

@ -332,13 +332,13 @@ DEFER: [bind-uniform-tuple]
] [ ] [
{ [ ] } { [ ] }
name "." append 1array name "." append 1array
] if* :> name-prefixes :> quot-prefixes ] if* :> ( quot-prefixes name-prefixes )
type all-uniform-tuple-slots :> uniforms type all-uniform-tuple-slots :> uniforms
texture-unit quot-prefixes name-prefixes [| quot-prefix name-prefix | texture-unit quot-prefixes name-prefixes [| quot-prefix name-prefix |
uniforms name-prefix [bind-uniform-tuple] uniforms name-prefix [bind-uniform-tuple]
quot-prefix prepend quot-prefix prepend
] 2map :> value-cleave :> texture-unit' ] 2map :> ( texture-unit' value-cleave )
texture-unit' texture-unit'
value>>-quot { value-cleave 2cleave } append ; value>>-quot { value-cleave 2cleave } append ;
@ -356,7 +356,7 @@ DEFER: [bind-uniform-tuple]
} cond ; } cond ;
:: [bind-uniform-tuple] ( texture-unit uniforms prefix -- texture-unit' quot ) :: [bind-uniform-tuple] ( texture-unit uniforms prefix -- texture-unit' quot )
texture-unit uniforms [ prefix [bind-uniform] ] map :> uniforms-cleave :> texture-unit' texture-unit uniforms [ prefix [bind-uniform] ] map :> ( texture-unit' uniforms-cleave )
texture-unit' texture-unit'
{ uniforms-cleave 2cleave } >quotation ; { uniforms-cleave 2cleave } >quotation ;

View File

@ -35,8 +35,8 @@ M: matrix4 new-sequence 2drop matrix4 (struct) ; inline
:: 2map-columns ( a b quot -- c ) :: 2map-columns ( a b quot -- c )
[ [
a columns :> a4 :> a3 :> a2 :> a1 a columns :> ( a1 a2 a3 a4 )
b columns :> b4 :> b3 :> b2 :> b1 b columns :> ( b1 b2 b3 b4 )
a1 b1 quot call a1 b1 quot call
a2 b2 quot call a2 b2 quot call
@ -61,8 +61,8 @@ TYPED: n/m4 ( a: float b: matrix4 -- c: matrix4 ) [ n/v ] with map-columns ;
TYPED:: m4. ( a: matrix4 b: matrix4 -- c: matrix4 ) TYPED:: m4. ( a: matrix4 b: matrix4 -- c: matrix4 )
[ [
a columns :> a4 :> a3 :> a2 :> a1 a columns :> ( a1 a2 a3 a4 )
b columns :> b4 :> b3 :> b2 :> b1 b columns :> ( b1 b2 b3 b4 )
b1 first a1 n*v :> c1a b1 first a1 n*v :> c1a
b2 first a1 n*v :> c2a b2 first a1 n*v :> c2a
@ -86,7 +86,7 @@ TYPED:: m4. ( a: matrix4 b: matrix4 -- c: matrix4 )
] make-matrix4 ; ] make-matrix4 ;
TYPED:: m4.v ( m: matrix4 v: float-4 -- v': float-4 ) TYPED:: m4.v ( m: matrix4 v: float-4 -- v': float-4 )
m columns :> m4 :> m3 :> m2 :> m1 m columns :> ( m1 m2 m3 m4 )
v first m1 n*v v first m1 n*v
v second m2 n*v v+ v second m2 n*v v+

View File

@ -60,7 +60,7 @@ TUPLE: nurbs-curve
:: (eval-bases) ( curve t interval values order -- values' ) :: (eval-bases) ( curve t interval values order -- values' )
order 2 - curve (knot-constants)>> nth :> all-knot-constants order 2 - curve (knot-constants)>> nth :> all-knot-constants
interval order interval + all-knot-constants clip-range :> to :> from interval order interval + all-knot-constants clip-range :> ( from to )
from to all-knot-constants subseq :> knot-constants from to all-knot-constants subseq :> knot-constants
values { 0.0 } { 0.0 } surround 2 <clumps> :> bases values { 0.0 } { 0.0 } surround 2 <clumps> :> bases

View File

@ -49,7 +49,7 @@ M: product-sequence nth
product@ nths ; product@ nths ;
:: product-each ( sequences quot -- ) :: product-each ( sequences quot -- )
sequences start-product-iter :> lengths :> ns sequences start-product-iter :> ( ns lengths )
lengths [ 0 = ] any? [ lengths [ 0 = ] any? [
[ ns lengths end-product-iter? ] [ ns lengths end-product-iter? ]
[ ns sequences nths quot call ns lengths product-iter ] until [ ns sequences nths quot call ns lengths product-iter ] until

View File

@ -69,12 +69,12 @@ fetched-in parsed-html links processed-in fetched-at ;
:: fill-spidered-result ( spider spider-result -- ) :: fill-spidered-result ( spider spider-result -- )
f spider-result url>> spider spidered>> set-at f spider-result url>> spider spidered>> set-at
[ spider-result url>> http-get ] benchmark :> fetched-in :> html :> headers [ spider-result url>> http-get ] benchmark :> ( headers html fetched-in )
[ [
html parse-html html parse-html
spider currently-spidering>> spider currently-spidering>>
over find-all-links normalize-hrefs over find-all-links normalize-hrefs
] benchmark :> processed-in :> links :> parsed-html ] benchmark :> ( parsed-html links processed-in )
spider-result spider-result
headers >>headers headers >>headers
fetched-in >>fetched-in fetched-in >>fetched-in