Remove unused error class
parent
a30dbec5fb
commit
46c3f0def1
|
@ -51,13 +51,12 @@ M: sequence random ( seq -- elt )
|
||||||
[ length random-integer ] keep nth
|
[ length random-integer ] keep nth
|
||||||
] if-empty ;
|
] if-empty ;
|
||||||
|
|
||||||
ERROR: negative-random n ;
|
|
||||||
M: integer random ( integer -- integer' )
|
M: integer random ( integer -- integer' )
|
||||||
{
|
dup sgn {
|
||||||
{ [ dup 0 = ] [ ] }
|
{ 0 [ ] }
|
||||||
{ [ dup 0 < ] [ neg random-integer neg ] }
|
{ -1 [ neg random-integer neg ] }
|
||||||
[ random-integer ]
|
{ 1 [ random-integer ] }
|
||||||
} cond ;
|
} case ;
|
||||||
|
|
||||||
: delete-random ( seq -- elt )
|
: delete-random ( seq -- elt )
|
||||||
[ length random-integer ] keep [ nth ] 2keep delete-nth ;
|
[ length random-integer ] keep [ nth ] 2keep delete-nth ;
|
||||||
|
|
Loading…
Reference in New Issue