Changeset 642 for src/Prim.hs

Show
Ignore:
Timestamp:
03/13/05 08:15:39 (4 years ago)
Author:
nothingmuch
svk:copy_cache_prev:
1998
Message:

Attempt at Y and yen operators

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Prim.hs

    r635 r642  
    3434op0 "not" = const retEmpty 
    3535op0 s    = \x -> return $ VError ("unimplemented listOp: " ++ s) (Val $ VList x) 
     36 
     37op0 "¥" = return . VList . concat . transpose . map vCast 
     38op0 "Y" = op0 "¥" 
    3639 
    3740retEmpty = do 
     
    6972    liftIO $ writeIORef ref $ case val of 
    7073        (VStr str)  -> VStr $ strInc str 
    71         _           -> op1Numeric (+1) (vCast val) 
     74        b           -> op1Numeric (+1) (vCast val) 
    7275    case val of 
    7376        (VStr _)    -> return val 
     
    695698\\n   List      left    »xx«    (Any, Any)\ 
    696699\\n   List      list    ,       (List)\ 
     700\\n   List      list    ¥               (List)\ 
     701\\n   List      list    Y               (List)\ 
    697702\\n   List      spre    <==     (List)\ 
    698703\\n   List      left    ==>     (List, Code)\