Show
Ignore:
Timestamp:
12/19/06 01:47:53 (2 years ago)
Author:
luqui
Message:

Implemented @list.pick(*).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/List.hs

    r14926 r14927  
    7272    ref <- readRef r 
    7373    op2Pick ref num 
     74op2Pick l@(VList xs) (VNum n) 
     75    | n == 1/0  = op2Pick l (VInt . toInteger $ length xs) 
     76    | otherwise = op2Pick l (VInt . toInteger $ floor n) 
    7477op2Pick (VList xs) (VInt num) = do 
    7578    shuffled <- shuffleN (fromInteger num) xs