Type | Wish | Status | submitted | Date | 5-Aug-2015 08:16 |
---|---|---|---|---|---|
Version | r3 master | Category | Unspecified | Submitted by | fork |
Platform | All | Severity | major | Priority | normal |
Summary | ANY-FUNCTION!s in PARSE invoke with match arguments (if success) |
---|---|
Description |
We see in Red the addition of KEEP and COLLECT keywords. Yet there's not really anything all that specifically sensible about PARSE needing its own KEEP and COLLECT. It's a specific implementation of a more general desire. The desire is effectively "I want to match a rule and have the thing that rule matches implicitly grabbed as an argument to a function without naming it" Which is to say that **keep rule** is shorter than **copy x: rule (keep x)** This points to an explosion of parse keywords to supplant existing Rebol functionality. Which leads us to ask if there might be a better way to say "I want to call this function and pass it the result of a successful match". What if that were simply the behavior of function values in parse itself? That is to say: if a function value is hit, then if its arity N can be fulfilled by N parse rule groups satisfied without failure, then the function is run? That would mean **collect [parse "abbbbc" ["a" keep some "b" "c"]]** would match the "a", evaluate and hold the keep as a function, satisfy **some "b"** and then realize it had enough arguments to run the function. |
Example code |
Assigned to | n/a | Fixed in | - | Last Update | 5-Aug-2015 08:23 |
---|
Date | User | Field | Action | Change |
---|---|---|---|---|
5-Aug-2015 08:23 | Fork | Description | Modified | - |
5-Aug-2015 08:16 | Fork | Ticket | Added | - |