] [
3dup nth-unsafe at*
[ >r 3drop r> ] [ drop >r 1- r> (assoc-stack) ] if
- ] if ; inline
+ ] if ; inline recursive
: assoc-stack ( key seq -- value )
dup length 1- swap (assoc-stack) ;
[ [ from>> ] [ midpoint@ ] bi + ] [ seq>> ] bi
[ drop ] [ dup ] [ ] tri* nth ; inline
-: (search) ( quot seq -- i elt )
+: (search) ( quot: ( elt -- <=> ) seq -- i elt )
dup length 1 <= [
finish
] [
{ +lt+ [ dup midpoint@ head-slice (search) ] }
{ +gt+ [ dup midpoint@ tail-slice (search) ] }
} case
- ] if ; inline
+ ] if ; inline recursive
PRIVATE>
"flushable"
"foldable"
"inline"
+ "recursive"
"parsing"
"t"
"{"
: <buckets> ( initial length -- array )
next-power-of-2 swap [ nip clone ] curry map ;
-: distribute-buckets ( assoc initial quot -- buckets )
- spin [ length <buckets> ] keep
- [ >r 2dup r> dup first roll call (distribute-buckets) ] each
- nip ; inline
+: distribute-buckets ( alist initial quot -- buckets )
+ swapd [ >r dup first r> call 2array ] curry map
+ [ length <buckets> dup ] keep
+ [ first2 (distribute-buckets) ] with each ; inline
: hash-case-table ( default assoc -- array )
V{ } [ 1array ] distribute-buckets
[ peek-back ] [ pop-back* ] bi ;
: slurp-dequeue ( dequeue quot -- )
- over dequeue-empty? [ 2drop ] [
- [ [ pop-back ] dip call ] [ slurp-dequeue ] 2bi
- ] if ; inline
+ [ drop [ dequeue-empty? not ] curry ]
+ [ [ pop-back ] prepose curry ] 2bi [ ] while ; inline
MIXIN: dequeue
: set-front-to-back ( dlist -- )
dup front>> [ dup back>> >>front ] unless drop ;
-: (dlist-find-node) ( dlist-node quot -- node/f ? )
+: (dlist-find-node) ( dlist-node quot: ( node -- ? ) -- node/f ? )
over [
[ call ] 2keep rot
[ drop t ] [ >r next>> r> (dlist-find-node) ] if
- ] [ 2drop f f ] if ; inline
+ ] [ 2drop f f ] if ; inline recursive
: dlist-find-node ( dlist quot -- node/f ? )
>r front>> r> (dlist-find-node) ; inline
! Copyright (C) 2006, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel math namespaces sequences strings words assocs
-combinators accessors ;
+combinators accessors arrays ;
IN: effects
TUPLE: effect in out terminated? ;
[ t ]
} cond 2nip ;
-GENERIC: (stack-picture) ( obj -- str )
-M: string (stack-picture) ;
-M: word (stack-picture) name>> ;
-M: integer (stack-picture) drop "object" ;
+GENERIC: effect>string ( obj -- str )
+M: string effect>string ;
+M: word effect>string name>> ;
+M: integer effect>string drop "object" ;
+M: pair effect>string first2 [ effect>string ] bi@ ": " swap 3append ;
: stack-picture ( seq -- string )
- [ [ (stack-picture) % CHAR: \s , ] each ] "" make ;
+ [ [ effect>string % CHAR: \s , ] each ] "" make ;
-: effect>string ( effect -- string )
+M: effect effect>string ( effect -- string )
[
"( " %
[ in>> stack-picture % "-- " % ]
M: effect clone
[ in>> clone ] [ out>> clone ] bi <effect> ;
+: stack-height ( word -- n )
+ stack-effect effect-height ;
+
: split-shuffle ( stack shuffle -- stack1 stack2 )
in>> length cut* ;
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: lexer sets sequences kernel splitting effects ;
+USING: lexer sets sequences kernel splitting effects summary
+combinators debugger arrays parser ;
IN: effects.parser
-: parse-effect ( end -- effect )
- parse-tokens dup { "(" "((" } intersect empty? [
- { "--" } split1 dup [
- <effect>
- ] [
- "Stack effect declaration must contain --" throw
+DEFER: parse-effect
+
+ERROR: bad-effect ;
+
+M: bad-effect summary
+ drop "Bad stack effect declaration" ;
+
+: parse-effect-token ( end -- token/f )
+ scan tuck = [ drop f ] [
+ dup { f "(" "((" } member? [ bad-effect ] [
+ ":" ?tail [
+ scan-word {
+ { \ ( [ ")" parse-effect ] }
+ [ ]
+ } case 2array
+ ] when
] if
- ] [
- "Stack effect declaration must not contain ( or ((" throw
] if ;
+
+: parse-effect-tokens ( end -- tokens )
+ [ parse-effect-token dup ] curry [ ] [ drop ] produce ;
+
+: parse-effect ( end -- effect )
+ parse-effect-tokens { "--" } split1 dup
+ [ <effect> ] [ "Stack effect declaration must contain --" throw ] if ;
PREDICATE: method-body < word
"method-generic" word-prop >boolean ;
+M: method-body inline?
+ "method-generic" word-prop inline? ;
+
M: method-body stack-effect
"method-generic" word-prop stack-effect ;
[ extra-values ] [ stack-effect ] bi
dup [ clone [ length + ] change-in ] [ 2drop f ] if ;
+M: engine-word inline?
+ "tuple-dispatch-generic" word-prop inline? ;
+
M: engine-word crossref? "forgotten" word-prop not ;
M: engine-word irrelevant? drop t ;
SYMBOL: previous
-: (closure) ( obj quot -- )
+: (closure) ( obj quot: ( elt -- assoc ) -- )
over previous get key? [
2drop
] [
over previous get conjoin
dup slip
[ nip (closure) ] curry assoc-each
- ] if ; inline
+ ] if ; inline recursive
: closure ( obj quot -- assoc )
H{ } clone [
dup ((empty)) eq?
[ 3drop no-key ] [
= [ rot drop t ] [ probe (key@) ] if
- ] if ; inline
+ ] if ; inline recursive
: key@ ( key hash -- array n ? )
array>> dup length>> 0 eq?
] [
probe (new-key@)
] if
- ] if ; inline
+ ] if ; inline recursive
: new-key@ ( key hash -- array n empty? )
array>> 2dup hash@ (new-key@) ; inline
[ unify-effects ] [ unify-dataflow ] bi ; inline
: infer-branches ( last branches node -- )
- #! last is a quotation which provides a #return or a #values
+ #! last -> #return or #values
+ #! node -> #if or #dispatch
1 reify-curries
call dup node,
pop-d drop
[ { ascii } declare decode-char ] \ decode-char inlined?
] unit-test
+[ t ] [ [ { 1 2 } length ] { length length>> slot } inlined? ] unit-test
+
! Later
! [ t ] [
: #dispatch ( -- node ) peek-d 1array \ #dispatch in-node ;
-TUPLE: #merge < node ;
+! Phi node: merging is a sequence of sequences of values
+TUPLE: #merge < node merging ;
: #merge ( -- node ) \ #merge all-out-node ;
: #drop ( n -- #shuffle )
d-tail flatten-curries \ #shuffle in-node ;
-: node-exists? ( node quot -- ? )
+: node-exists? ( node quot: ( node -- ? ) -- ? )
over [
2dup 2slip rot [
2drop t
] if
] [
2drop f
- ] if ; inline
+ ] if ; inline recursive
GENERIC: calls-label* ( label node -- ? )
: iterate-next ( -- node ) node@ successor>> ;
-: iterate-nodes ( node quot -- )
+: iterate-nodes ( node quot: ( -- ) -- )
over [
[ swap >node call node> drop ] keep iterate-nodes
] [
2drop
- ] if ; inline
+ ] if ; inline recursive
-: (each-node) ( quot -- next )
+: (each-node) ( quot: ( node -- ) -- next )
node@ [ swap call ] 2keep
node-children [
[
[ (each-node) ] keep swap
] iterate-nodes
] each drop
- iterate-next ; inline
+ iterate-next ; inline recursive
: with-node-iterator ( quot -- )
>r V{ } clone node-stack r> with-variable ; inline
2drop
] if ; inline
-: (transform-nodes) ( prev node quot -- )
+: (transform-nodes) ( prev node quot: ( node -- newnode ) -- )
dup >r call dup [
>>successor
successor>> dup successor>>
r> (transform-nodes)
] [
r> 2drop f >>successor drop
- ] if ; inline
+ ] if ; inline recursive
: transform-nodes ( node quot -- new-node )
over [
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel words sequences generic math
-namespaces quotations assocs combinators math.bitfields
+namespaces quotations assocs combinators
inference.backend inference.dataflow inference.state
classes.tuple classes.tuple.private effects summary hashtables
classes generic sets definitions generic.standard slots.private ;
\ spread [ spread>quot ] 1 define-transform
-! Bitfields
-GENERIC: (bitfield-quot) ( spec -- quot )
-
-M: integer (bitfield-quot) ( spec -- quot )
- [ swapd shift bitor ] curry ;
-
-M: pair (bitfield-quot) ( spec -- quot )
- first2 over word? [ >r swapd execute r> ] [ ] ?
- [ shift bitor ] append 2curry ;
-
-: bitfield-quot ( spec -- quot )
- [ (bitfield-quot) ] map [ 0 ] prefix concat ;
-
-\ bitfield [ bitfield-quot ] 1 define-transform
-
-\ flags [
- [ 0 , [ , \ bitor , ] each ] [ ] make
-] 1 define-transform
-
! Tuple operations
: [get-slots] ( slots -- quot )
[ [ 1quotation , \ keep , ] each \ drop , ] [ ] make ;
{ CHAR: \n [ line-ends\n ] }
} case ; inline
-: ((read-until)) ( buf quot -- string/f sep/f )
- ! quot: -- char stop?
+: ((read-until)) ( buf quot: ( -- char stop? ) -- string/f sep/f )
dup call
[ >r drop "" like r> ]
- [ pick push ((read-until)) ] if ; inline
+ [ pick push ((read-until)) ] if ; inline recursive
: (read-until) ( quot -- string/f sep/f )
100 <sbuf> swap ((read-until)) ; inline
: 2bi@ ( w x y z quot -- )
dup 2bi* ; inline
-: while ( pred body tail -- )
+: loop ( pred: ( -- ? ) -- )
+ dup slip swap [ loop ] [ drop ] if ; inline recursive
+
+: while ( pred: ( -- ? ) body: ( -- ) tail: ( -- ) -- )
>r >r dup slip r> r> roll
[ >r tuck 2slip r> while ]
- [ 2nip call ] if ; inline
+ [ 2nip call ] if ; inline recursive
! Object protocol
GENERIC: hashcode* ( depth obj -- code )
] recover ;
: until-quit ( -- )
- quit-flag get
- [ quit-flag off ]
- [ listen until-quit ] if ; inline
+ quit-flag get [ quit-flag off ] [ listen until-quit ] if ;
: listener ( -- )
[ until-quit ] with-interactive-vocabs ;
[ 3 ] [ foo ] unit-test
[ 3 ] [ { a b } flags ] unit-test
\ foo must-infer
+
+[ 0 ] [ { } bitfield-quot call ] unit-test
+
+[ 256 ] [ 1 { 8 } bitfield-quot call ] unit-test
+
+[ 268 ] [ 3 1 { 8 2 } bitfield-quot call ] unit-test
+
+[ 268 ] [ 1 { 8 { 3 2 } } bitfield-quot call ] unit-test
+
+[ 512 ] [ 1 { { 1+ 8 } } bitfield-quot call ] unit-test
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel math sequences words ;
+USING: arrays kernel math sequences words
+namespaces inference.transforms ;
IN: math.bitfields
GENERIC: (bitfield) ( value accum shift -- newaccum )
: flags ( values -- n )
0 [ dup word? [ execute ] when bitor ] reduce ;
+
+GENERIC: (bitfield-quot) ( spec -- quot )
+
+M: integer (bitfield-quot) ( spec -- quot )
+ [ swapd shift bitor ] curry ;
+
+M: pair (bitfield-quot) ( spec -- quot )
+ first2 over word? [ >r swapd execute r> ] [ ] ?
+ [ shift bitor ] append 2curry ;
+
+: bitfield-quot ( spec -- quot )
+ [ (bitfield-quot) ] map [ 0 ] prefix concat ;
+
+\ bitfield [ bitfield-quot ] 1 define-transform
+
+\ flags [
+ [ 0 , [ , \ bitor , ] each ] [ ] make
+] 1 define-transform
: (fixnum-log2) ( accum n -- accum )
dup 1 number= [ drop ] [ >r 1+ r> 2/ (fixnum-log2) ] if ;
- inline
+ inline recursive
M: fixnum (log2) 0 swap (fixnum-log2) ;
PRIVATE>
-: (each-integer) ( i n quot -- )
+: (each-integer) ( i n quot: ( i -- ) -- )
[ iterate-step iterate-next (each-integer) ]
- [ 3drop ] if-iterate? ; inline
+ [ 3drop ] if-iterate? ; inline recursive
-: (find-integer) ( i n quot -- i )
+: (find-integer) ( i n quot: ( i -- ? ) -- i )
[
iterate-step roll
[ 2drop ] [ iterate-next (find-integer) ] if
- ] [ 3drop f ] if-iterate? ; inline
+ ] [ 3drop f ] if-iterate? ; inline recursive
-: (all-integers?) ( i n quot -- ? )
+: (all-integers?) ( i n quot: ( i -- ? ) -- ? )
[
iterate-step roll
[ iterate-next (all-integers?) ] [ 3drop f ] if
- ] [ 3drop t ] if-iterate? ; inline
+ ] [ 3drop t ] if-iterate? ; inline recursive
: each-integer ( n quot -- )
iterate-prep (each-integer) ; inline
: all-integers? ( n quot -- ? )
iterate-prep (all-integers?) ; inline
-: find-last-integer ( n quot -- i )
+: find-last-integer ( n quot: ( i -- ? ) -- i )
over 0 < [
2drop f
] [
] [
>r 1- r> find-last-integer
] if
- ] if ; inline
+ ] if ; inline recursive
kernel.private sbufs growable assocs namespaces quotations
math strings combinators ;
-: (each-object) ( quot -- )
- next-object dup
- [ swap [ call ] keep (each-object) ] [ 2drop ] if ; inline
+: (each-object) ( quot: ( obj -- ) -- )
+ [ next-object dup ] swap [ drop ] while ; inline
: each-object ( quot -- )
begin-scan (each-object) end-scan ; inline
[ V{ } clone node-stack get length 3array ] keep
node-param label-info get set-at ;
-USE: prettyprint
-
M: #call-label collect-label-info*
node-param label-info get at
node-stack get over third tail
] 3keep ; inline
: (copy) ( dst i src j n -- dst )
- dup 0 <= [ 2drop 2drop ] [ 1- ((copy)) (copy) ] if ; inline
+ dup 0 <= [ 2drop 2drop ] [ 1- ((copy)) (copy) ] if ;
+ inline recursive
: prepare-subseq ( from to seq -- dst i src j n )
[ >r swap - r> new-sequence dup 0 ] 3keep
: halves ( seq -- first second )
dup midpoint@ cut-slice ;
-: binary-reduce ( seq start quot -- value )
+: binary-reduce ( seq start quot: ( elt1 elt2 -- newelt ) -- value )
#! We can't use case here since combinators depends on
#! sequences
pick length dup 0 3 between? [
>r >r halves r> r>
[ [ binary-reduce ] 2curry bi@ ] keep
call
- ] if ; inline
+ ] if ; inline recursive
: cut ( seq n -- before after )
[ head ] [ tail ] 2bi ;
: r-next [ [ r-elt ] [ [ 1+ ] change-from2 drop ] bi ] [ accum>> ] bi push ; inline
: decide [ [ l-elt ] [ r-elt ] bi ] dip call +gt+ eq? ; inline
-: (merge) ( merge quot -- )
+: (merge) ( merge quot: ( elt1 elt2 -- <=> ) -- )
over r-done? [ drop dump-l ] [
over l-done? [ drop dump-r ] [
2dup decide
[ over r-next ] [ over l-next ] if
(merge)
] if
- ] if ; inline
+ ] if ; inline recursive
: flip-accum ( merge -- )
dup [ accum>> ] [ accum1>> ] bi eq? [
[ merge ] 2curry each-chunk ; inline
: sort-loop ( merge quot -- )
- 2 swap
- [ pick seq>> length pick > ]
- [ [ dup ] [ 1 shift ] [ ] tri* [ sort-pass ] 2keep ]
- [ ] while 3drop ; inline
+ [ 2 [ over seq>> length over > ] ] dip
+ [ [ 1 shift 2dup ] dip sort-pass ] curry
+ [ ] while 2drop ; inline
: each-pair ( seq quot -- )
[ [ length 1+ 2/ ] keep ] dip
: (split) ( separators n seq -- )
3dup rot [ member? ] curry find-from drop
[ [ swap subseq , ] 2keep 1+ swap (split) ]
- [ swap dup zero? [ drop ] [ tail ] if , drop ] if* ; inline
+ [ swap dup zero? [ drop ] [ tail ] if , drop ] if* ; inline recursive
: split, ( seq separators -- ) 0 rot (split) ;
"POSTPONE:" [ scan-word parsed ] define-syntax
"\\" [ scan-word literalize parsed ] define-syntax
"inline" [ word make-inline ] define-syntax
+ "recursive" [ word make-recursive ] define-syntax
"foldable" [ word make-foldable ] define-syntax
"flushable" [ word make-flushable ] define-syntax
"delimiter" [ word t "delimiter" set-word-prop ] define-syntax
<thread> [ (spawn) ] keep ;
: spawn-server ( quot name -- thread )
- >r [ [ ] [ ] while ] curry r> spawn ;
+ >r [ loop ] curry r> spawn ;
: in-thread ( quot -- )
>r datastack r>
: make-inline ( word -- )
t "inline" set-word-prop ;
+: make-recursive ( word -- )
+ t "recursive" set-word-prop ;
+
: make-flushable ( word -- )
t "flushable" set-word-prop ;
M: word reset-word
{
"unannotated-def"
- "parsing" "inline" "foldable" "flushable"
+ "parsing" "inline" "recursive" "foldable" "flushable"
"predicating"
"reading" "writing"
"constructing"
: constructor-word ( name vocab -- word )
>r "<" swap ">" 3append r> create ;
+GENERIC: inline? ( word -- ? )
+
+M: word inline? "inline" word-prop ;
+
PREDICATE: parsing-word < word "parsing" word-prop ;
: delimiter? ( obj -- ? )
] with-malloc
] with-malloc ; inline
-:: (NSFastEnumeration-each) ( object quot state stackbuf count -- )
+:: (NSFastEnumeration-each) ( object quot: ( elt -- ) state stackbuf count -- )
object state stackbuf count -> countByEnumeratingWithState:objects:count:
dup zero? [ drop ] [
state NSFastEnumerationState-itemsPtr [ stackbuf ] unless*
'[ , void*-nth quot call ] each
object quot state stackbuf count (NSFastEnumeration-each)
- ] if ; inline
+ ] if ; inline recursive
: NSFastEnumeration-each ( object quot -- )
[ (NSFastEnumeration-each) ] (with-enumeration-buffers) ; inline
: wait-for-mailbox ( mailbox timeout -- )\r
>r threads>> r> "mailbox" wait ;\r
\r
-: block-unless-pred ( mailbox timeout pred -- )\r
+: block-unless-pred ( mailbox timeout pred: ( message -- ? ) -- )\r
pick check-disposed\r
pick data>> over dlist-contains? [\r
3drop\r
] [\r
>r 2dup wait-for-mailbox r> block-unless-pred\r
- ] if ; inline\r
+ ] if ; inline recursive\r
\r
: block-if-empty ( mailbox timeout -- mailbox )\r
over check-disposed\r
f mailbox-get-all-timeout ;\r
\r
: while-mailbox-empty ( mailbox quot -- )\r
- over mailbox-empty? [\r
- dup >r dip r> while-mailbox-empty\r
- ] [\r
- 2drop\r
- ] if ; inline\r
+ [ [ mailbox-empty? ] curry ] dip [ ] while ; inline\r
\r
: mailbox-get-timeout? ( mailbox timeout pred -- obj )\r
3dup block-unless-pred\r
} match-cond ;
[ -5 ] [
- [ 0 [ counter ] [ ] [ ] while ] "Counter" spawn "counter" set
+ [ 0 [ counter ] loop ] "Counter" spawn "counter" set
{ increment 10 } "counter" get send
{ decrement 15 } "counter" get send
[ value , self , ] { } make "counter" get send
dup print flush
dup parent-directory
[ right-trim-separators "xyz" tail? ] either? not
- ] [ ] [ ] while
+ ] loop
"c1" get count-down
dup print flush
dup parent-directory
[ right-trim-separators "yxy" tail? ] either? not
- ] [ ] [ ] while
+ ] loop
"c2" get count-down
] "Monitor test thread" spawn drop
local-index 1+ [ get-local ] curry ;
: localize-writer ( obj args -- quot )
- >r "local-reader" word-prop r>
- read-local-quot [ set-local-value ] append ;
+ >r "local-reader" word-prop r>
+ read-local-quot [ set-local-value ] append ;
: localize ( obj args -- quot )
{
: parse-locals ( -- vars assoc )
")" parse-effect
word [ over "declared-effect" set-word-prop ] when*
- effect-in make-locals dup push-locals ;
+ in>> [ dup pair? [ first ] when ] map make-locals dup push-locals ;
: parse-locals-definition ( word -- word quot )
scan "(" assert= parse-locals \ ; (parse-lambda) <lambda>
M: real sqrt
>float dup 0.0 < [ neg fsqrt 0.0 swap rect> ] [ fsqrt ] if ;
-: each-bit ( n quot -- )
+: each-bit ( n quot: ( ? -- ) -- )
over 0 number= pick -1 number= or [
2drop
] [
2dup >r >r >r odd? r> call r> 2/ r> each-bit
- ] if ; inline
+ ] if ; inline recursive
GENERIC: (^) ( x y -- z ) foldable
dup string? swap number? or not
] [ drop f ] if ;
-: deep-each ( obj quot -- )
+: deep-each ( obj quot: ( elt -- ) -- )
[ call ] 2keep over branch?
- [ [ deep-each ] curry each ] [ 2drop ] if ; inline
+ [ [ deep-each ] curry each ] [ 2drop ] if ; inline recursive
-: deep-map ( obj quot -- newobj )
+: deep-map ( obj quot: ( elt -- elt' ) -- newobj )
[ call ] keep over branch?
- [ [ deep-map ] curry map ] [ drop ] if ; inline
+ [ [ deep-map ] curry map ] [ drop ] if ; inline recursive
-: deep-filter ( obj quot -- seq )
+: deep-filter ( obj quot: ( elt -- ? ) -- seq )
over >r
pusher >r deep-each r>
- r> dup branch? [ like ] [ drop ] if ; inline
+ r> dup branch? [ like ] [ drop ] if ; inline recursive
-: deep-find-from ( obj quot -- elt ? )
+: deep-find-from ( obj quot: ( elt -- ? ) -- elt ? )
[ call ] 2keep rot [ drop t ] [
over branch? [
f -rot [ >r nip r> deep-find-from ] curry find drop >boolean
] [ 2drop f f ] if
- ] if ; inline
+ ] if ; inline recursive
: deep-find ( obj quot -- elt ) deep-find-from drop ; inline
: deep-all? ( obj quot -- ? )
[ not ] compose deep-contains? not ; inline
-: deep-change-each ( obj quot -- )
+: deep-change-each ( obj quot: ( elt -- elt' ) -- )
over branch? [ [
[ call ] keep over >r deep-change-each r>
- ] curry change-each ] [ 2drop ] if ; inline
+ ] curry change-each ] [ 2drop ] if ; inline recursive
: flatten ( obj -- seq )
[ branch? not ] deep-filter ;
IN: sorting.insertion
<PRIVATE
-:: insert ( seq quot n -- )
+:: insert ( seq quot: ( elt -- elt' ) n -- )
n zero? [
n n 1- [ seq nth quot call ] bi@ >= [
n n 1- seq exchange
seq quot n 1- insert
] unless
- ] unless ; inline
+ ] unless ; inline recursive
PRIVATE>
: insertion-sort ( seq quot -- )
M: cocoa-ui-backend do-events ( -- )
[
- [
- NSApp [ dup do-event ] [ ] [ ] while drop
- ui-wait
- ] ui-try
+ [ NSApp [ do-event ] curry loop ui-wait ] ui-try
] with-autorelease-pool ;
TUPLE: pasteboard handle ;
i end < [
i j bitmap texture copy-pixel
bitmap texture end (copy-row)
- ] when ; inline
+ ] when ; inline recursive
:: copy-row ( i j bitmap texture width width2 -- i j )
i j bitmap texture i width + (copy-row)