parent
598127c0e2
commit
c5cc14de91
|
@ -2,16 +2,16 @@ USING: assocs kernel sequences ;
|
|||
IN: new-effects
|
||||
|
||||
: new-nth ( seq n -- elt )
|
||||
swap nth ;
|
||||
swap nth ; inline
|
||||
|
||||
: new-set-nth ( seq obj n -- seq )
|
||||
pick set-nth ;
|
||||
pick set-nth ; inline
|
||||
|
||||
: new-at ( assoc key -- elt )
|
||||
swap at ;
|
||||
swap at ; inline
|
||||
|
||||
: new-at* ( assoc key -- elt ? )
|
||||
swap at* ;
|
||||
swap at* ; inline
|
||||
|
||||
: new-set-at ( assoc value key -- assoc )
|
||||
pick set-at ;
|
||||
pick set-at ; inline
|
||||
|
|
|
@ -4,14 +4,11 @@
|
|||
! http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
|
||||
|
||||
USING: arrays kernel math namespaces sequences system init
|
||||
accessors math.ranges combinators.cleave random ;
|
||||
accessors math.ranges combinators.cleave random new-effects ;
|
||||
IN: random.mersenne-twister
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: new-nth ( seq i -- elt ) swap nth ; inline
|
||||
: new-set-nth ( seq obj n -- seq ) pick set-nth ; inline
|
||||
|
||||
TUPLE: mersenne-twister seq i ;
|
||||
|
||||
: mt-n 624 ; inline
|
||||
|
|
Loading…
Reference in New Issue