Changeset 12207 for src/Pugs/Eval

Show
Ignore:
Timestamp:
08/14/06 09:34:33 (2 years ago)
Author:
audreyt
Message:

* Slurpyness evaluation now uses array_fetchSize, so this is

now constant time:

my @x[9999999] = 1; @x.elems

note that we still doesn't support (1..Inf).elems.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r12200 r12207  
    344344        doFindSub (sum lens) subSyms 
    345345    argSlurpLen :: Exp -> Eval Int 
    346     argSlurpLen (Val listMVal) = do 
    347         listVal  <- fromVal listMVal 
    348         fmap length (fromVal listVal :: Eval [Val]) 
     346    argSlurpLen (Val val) = join $ doArray val array_fetchSize 
    349347    argSlurpLen (Var name) = do 
    350         listMVal <- evalExp (Var name) 
    351         listVal  <- fromVal listMVal 
    352         fmap length (fromVal listVal :: Eval [Val]) 
     348        val <- evalExp (Var name) 
     349        join $ doArray val array_fetchSize 
    353350    argSlurpLen (Syn "," list) =  return $ length list 
    354351    argSlurpLen _ = return 1 -- XXX