Changeset 3145

Show
Ignore:
Timestamp:
05/13/05 10:18:27 (4 years ago)
Author:
scook0
svk:copy_cache_prev:
4718
Message:

Fixed & added Haddocks for Bind.hs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Bind.hs

    r3144 r3145  
    4949are given, only the first gets the arguments--the rest get an empty hash. 
    5050Used by 'bindSomeParams'. 
    51  
    52 >[12:16] <scook0> autrijus: At the moment, if you call a sub that has multiple slurpy arrays,  
    53 >                   Pugs deliberately binds the first one normally, and makes all the rest empty 
    54 >[12:17] <scook0> Is this proper behaviour, or is it just a quirk of the current implementation? 
    55 >[12:17] <autrijus> no, that's specced. 
    56 >[12:17] <autrijus> i.e. correct 
    5751-} 
    5852bindHash :: [Exp]   -- ^ Named arguments (pair expressions) that were not 
     
    6761bindHash vs [p]         = return [ (p, Syn "\\{}" [Syn "," vs]) ] -- XXX cast to Hash 
    6862 
    69 bindArray :: [Exp] -> [Param] -> SlurpLimit -> MaybeError (Bindings, SlurpLimit) 
     63{-| 
     64Create bindings from the slurpy scalar and array parameters to the remaining 
     65positional arguments. The first slurpy array param gets all of the remaining 
     66args; subsequent slurpy array params get an empty array. Slurpy scalars may 
     67not appear after slurpy array params. 
     68 
     69Returns the bindings performed, and the sub's new 'SlurpLimit'. 
     70 
     71Mostly uses 'doBindArray' to do its dirty work. Used by 'bindSomeParams'. 
     72 
     73>[12:16] <scook0> autrijus: At the moment, if you call a sub that has multiple slurpy arrays,  
     74>                   Pugs deliberately binds the first one normally, and makes all the rest empty 
     75>[12:17] <scook0> Is this proper behaviour, or is it just a quirk of the current implementation? 
     76>[12:17] <autrijus> no, that's specced. 
     77>[12:17] <autrijus> i.e. correct 
     78-} 
     79bindArray :: [Exp]      -- ^ List of slurpable argument expressions 
     80          -> [Param]    -- ^ List of all slurpy positional params (scalar and array) 
     81          -> SlurpLimit -- ^ The sub's current 'SlurpLimit' 
     82          -> MaybeError (Bindings, SlurpLimit) 
    7083bindArray vs ps oldLimit = do 
    7184    let exp = Cxt cxtSlurpyAny (Syn "," vs)