remove most uses of roll/-roll from extra
parent
2bc75e390a
commit
cac1778bd0
|
@ -1,6 +1,6 @@
|
|||
USING: accessors alien.c-types arrays combinators destructors
|
||||
http.client io io.encodings.ascii io.files io.files.temp kernel
|
||||
math math.matrices math.parser math.vectors opengl
|
||||
locals math math.matrices math.parser math.vectors opengl
|
||||
opengl.capabilities opengl.gl opengl.demo-support sequences
|
||||
splitting vectors words specialized-arrays ;
|
||||
QUALIFIED-WITH: alien.c-types c
|
||||
|
@ -51,8 +51,11 @@ IN: bunny.model
|
|||
over download-to
|
||||
] unless ;
|
||||
|
||||
: (draw-triangle) ( ns vs triple -- )
|
||||
[ dup roll nth gl-normal swap nth gl-vertex ] with with each ;
|
||||
:: (draw-triangle) ( ns vs triple -- )
|
||||
triple [| elt |
|
||||
elt ns nth gl-normal
|
||||
elt vs nth gl-vertex
|
||||
] each ;
|
||||
|
||||
: draw-triangles ( ns vs is -- )
|
||||
GL_TRIANGLES [ [ (draw-triangle) ] with with each ] do-state ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2007 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel math math.functions ;
|
||||
USING: kernel locals math math.functions ;
|
||||
IN: math.quadratic
|
||||
|
||||
: monic ( c b a -- c' b' ) tuck [ / ] 2bi@ ;
|
||||
|
@ -12,9 +12,7 @@ IN: math.quadratic
|
|||
: +- ( x y -- x+y x-y ) [ + ] [ - ] 2bi ;
|
||||
|
||||
: quadratic ( c b a -- alpha beta )
|
||||
#! Solve a quadratic equation ax^2 + bx + c = 0
|
||||
monic discriminant critical +- ;
|
||||
|
||||
: qeval ( x c b a -- y )
|
||||
#! Evaluate ax^2 + bx + c
|
||||
[ pick * ] dip roll sq * + + ;
|
||||
:: qeval ( x c b a -- y )
|
||||
c b x * + a x sq * + ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors assocs deques dlists kernel ;
|
||||
USING: accessors assocs deques dlists kernel locals ;
|
||||
IN: spider.unique-deque
|
||||
|
||||
TUPLE: todo-url url depth ;
|
||||
|
@ -30,8 +30,9 @@ TUPLE: unique-deque assoc deque ;
|
|||
|
||||
: peek-url ( unique-deque -- todo-url ) deque>> peek-front ;
|
||||
|
||||
: slurp-deque-when ( deque quot1 quot2: ( value -- ) -- )
|
||||
pick deque-empty? [ 3drop ] [
|
||||
[ [ pop-front dup ] 2dip [ call ] dip [ t ] compose [ drop f ] if ]
|
||||
[ roll [ slurp-deque-when ] [ 3drop ] if ] 3bi
|
||||
] if ; inline recursive
|
||||
:: slurp-deque-when ( deque quot1 quot2: ( value -- ) -- )
|
||||
deque deque-empty? [
|
||||
deque pop-front dup quot1 call
|
||||
[ quot2 call t ] [ drop f ] if
|
||||
[ deque quot1 quot2 slurp-deque-when ] when
|
||||
] unless ; inline recursive
|
||||
|
|
|
@ -16,7 +16,7 @@ MEMO: single-sine-wave ( samples/wave -- seq )
|
|||
[ sample-freq>> -rot sine-wave ] keep swap >>data ;
|
||||
|
||||
: >silent-buffer ( seconds buffer -- buffer )
|
||||
tuck sample-freq>> * >integer 0 <repetition> >>data ;
|
||||
[ sample-freq>> * >integer 0 <repetition> ] [ (>>data) ] [ ] tri ;
|
||||
|
||||
TUPLE: harmonic n amplitude ;
|
||||
C: <harmonic> harmonic
|
||||
|
@ -32,5 +32,5 @@ C: <note> note
|
|||
harmonic amplitude>> <scaled> ;
|
||||
|
||||
: >note ( harmonics note buffer -- buffer )
|
||||
dup -roll [ note-harmonic-data ] 2curry map <summed> >>data ;
|
||||
[ [ note-harmonic-data ] 2curry map <summed> ] [ (>>data) ] [ ] tri ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue