| 69 | | bindArray :: [Exp] -> [Param] -> SlurpLimit -> MaybeError (Bindings, SlurpLimit) |
| | 63 | {-| |
| | 64 | Create bindings from the slurpy scalar and array parameters to the remaining |
| | 65 | positional arguments. The first slurpy array param gets all of the remaining |
| | 66 | args; subsequent slurpy array params get an empty array. Slurpy scalars may |
| | 67 | not appear after slurpy array params. |
| | 68 | |
| | 69 | Returns the bindings performed, and the sub's new 'SlurpLimit'. |
| | 70 | |
| | 71 | Mostly 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 | -} |
| | 79 | bindArray :: [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) |