ui.gadgets.theme
ui.gadgets.handler
accessors
- namespaces.lib assocs.lib vars
+ vars fry
rewrite-closures automata math.geometry.rect newfx ;
IN: automata.ui
: draw-point ( y x value -- ) 1 = [ swap glVertex2i ] [ 2drop ] if ;
-: draw-line ( y line -- ) 0 swap [ >r 2dup r> draw-point 1+ ] each 2drop ;
+: draw-line ( y line -- ) 0 swap [ [ 2dup ] dip draw-point 1+ ] each 2drop ;
-: (draw-bitmap) ( bitmap -- ) 0 swap [ >r dup r> draw-line 1+ ] each drop ;
+: (draw-bitmap) ( bitmap -- ) 0 swap [ [ dup ] dip draw-line 1+ ] each drop ;
: draw-bitmap ( bitmap -- ) GL_POINTS glBegin (draw-bitmap) glEnd ;
! Create a quotation that is appropriate for buttons and gesture handler.
-: view-action ( quot -- quot ) [ drop [ ] with-view ] make* closed-quot ;
+: view-action ( quot -- quot ) '[ drop _ with-view ] closed-quot ;
-: view-button ( label quot -- ) >r <label> r> view-action <bevel-button> ;
+: view-button ( label quot -- button ) [ <label> ] dip view-action <bevel-button> ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
USING: kernel parser namespaces sequences quotations arrays vectors splitting
strings words math generalizations
- macros combinators.lib combinators.conditional newfx ;
+ macros combinators.conditional newfx ;
IN: bake
USING: kernel alien.c-types combinators namespaces make arrays
- sequences sequences.lib namespaces.lib splitting
+ sequences splitting
math math.functions math.vectors math.trig
opengl.gl opengl.glu opengl ui ui.gadgets.slate
vars colors self self.slots
: double-nth* ( c-array indices -- seq )
swap byte-array>double-array [ nth ] curry map ;
-: check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map biggest ;
+: check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map supremum ;
VAR: threshold
[ 6 + get-double ]
}
2cleave
- >r >r >r
- get-question-section r>
- get-rr-section r>
- get-rr-section r>
- get-rr-section
+ {
+ [ get-question-section ]
+ [ get-rr-section ]
+ [ get-rr-section ]
+ [ get-rr-section ]
+ } spread
2drop
]
}
: ba->message ( ba -- message ) parse-message ;
-: with-message-bytes ( ba quot -- ) >r ba->message r> call message->ba ; inline
+: with-message-bytes ( ba quot -- ) [ ba->message ] dip call message->ba ; inline
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
USING: kernel combinators sequences sets math threads namespaces continuations
debugger io io.sockets unicode.case accessors destructors
- combinators.cleave combinators.lib combinators.short-circuit
- newfx bake bake.fry
+ combinators.cleave combinators.short-circuit
+ newfx fry
dns dns.util dns.misc ;
IN: dns.server
[ receive-packet handle-request ] [ receive-loop ] bi ;
: loop ( addr-spec -- )
- [ <datagram> '[ , [ receive-loop ] with-disposal ] try ] [ loop ] bi ;
+ [ <datagram> '[ _ [ receive-loop ] with-disposal ] try ] [ loop ] bi ;
-USING: kernel sequences sorting math math.order macros bake bake.fry ;
+USING: kernel sequences sorting math math.order macros fry ;
IN: dns.util
: tri-chain ( obj p q r -- x y z )
- >r >r call dup r> call dup r> call ; inline
+ [ [ call dup ] dip call dup ] dip call ; inline
-MACRO: 1if ( test then else -- ) '[ dup @ , , if ] ;
-
-! : 1if ( test then else -- ) >r >r >r dup r> call r> r> if ; inline ;
+MACRO: 1if ( test then else -- ) '[ dup @ _ _ if ] ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Copyright (c) 2008 Reginald Keith Ford II.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math arrays sequences sequences.lib ;
+USING: kernel math arrays sequences ;
IN: math.function-tools
! Tools for quickly comparing, transforming, and evaluating mathematical functions
-USING: kernel sequences assocs circular sets fry sequences.lib ;
+USING: kernel sequences assocs circular sets fry ;
USING: math multi-methods ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-METHOD: is-of { number object sequence } dup >r swapd set-nth r> ;
-METHOD: as-of { object number sequence } dup >r set-nth r> ;
+METHOD: is-of { number object sequence } dup [ swapd set-nth ] dip ;
+METHOD: as-of { object number sequence } dup [ set-nth ] dip ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-METHOD: is-of { object object assoc } dup >r swapd set-at r> ;
-METHOD: as-of { object object assoc } dup >r set-at r> ;
+METHOD: is-of { object object assoc } dup [ swapd set-at ] dip ;
+METHOD: as-of { object object assoc } dup [ set-at ] dip ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-: snip ( seq a b -- seq ) >r over r> [ head ] [ tail ] 2bi* append ;
+: snip ( seq a b -- seq ) [ over ] dip [ head ] [ tail ] 2bi* append ;
: snip-this ( a b seq -- seq ) -rot snip ;
: snip! ( seq a b -- seq ) pick delete-slice ;
: snip-this! ( a b seq -- seq ) -rot pick delete-slice ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-: invert-index ( seq i -- seq i ) >r dup length 1 - r> - ;
+: invert-index ( seq i -- seq i ) [ dup length 1 - ] dip - ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-: insert ( seq i obj -- seq ) >r cut r> prefix append ;
+: insert ( seq i obj -- seq ) [ cut ] dip prefix append ;
-: splice ( seq i seq -- seq ) >r cut r> prepend append ;
+: splice ( seq i seq -- seq ) [ cut ] dip prepend append ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
USING: kernel namespaces arrays quotations sequences assocs combinators
- mirrors math math.vectors random macros bake bake.fry ;
+ mirrors math math.vectors random macros fry ;
IN: random-weighted
MACRO: call-random-weighted ( exp -- )
[ keys ] [ values <enum> >alist ] bi
- '[ , random-weighted , case ] ;
+ '[ _ random-weighted _ case ] ;
-USING: kernel parser math quotations namespaces sequences macros
-bake bake.fry ;
+USING: kernel parser math quotations namespaces sequences macros fry ;
IN: rewrite-closures
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-: parametric-quot ( parameters quot -- quot ) '[ , set-parameters , call ] ;
+: parametric-quot ( parameters quot -- quot ) '[ _ set-parameters _ call ] ;
-: scoped-quot ( quot -- quot ) '[ , with-scope ] ;
+: scoped-quot ( quot -- quot ) '[ _ with-scope ] ;
: closed-quot ( quot -- quot )
- namestack swap '[ namestack [ , set-namestack @ ] dip set-namestack ] ;
+ namestack swap '[ namestack [ _ set-namestack @ ] dip set-namestack ] ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: with-self ( quot obj -- ) [ >self call ] with-scope ;
-: save-self ( quot -- ) self> >r self> clone >self call r> >self ;
-
-! : save-self ( quot -- ) [ self> clone >self call ] with-scope ;
\ No newline at end of file
+: save-self ( quot -- ) self> [ self> clone >self call ] dip >self ;
-USING: kernel accessors locals namespaces sequences sequences.lib threads
+USING: kernel accessors locals namespaces sequences threads
math math.order math.vectors
calendar
colors opengl ui ui.gadgets ui.gestures ui.render
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+: each-percent ( seq quot -- )
+ [
+ dup length
+ dup [ / ] curry
+ [ 1+ ] prepose
+ ] dip compose
+ 2each ; inline
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
M:: <trails-gadget> draw-gadget* ( GADGET -- )
origin get
[