On Aug 20, 2009, at 21:01, erik quanstrom <[email protected]> wrote:
Here's an example. Let's make the syntax extra pukey: @#, where # is 1-9, defines a `named procedure', which is the same thing as putting something in braces in Sam. x/.*\n/ @1{ ( @1 ) | @1 ( @1 ) ( ) | }x/re/ repeatedly sets . with matches until the input is exhausted. so i don't think i understand your example. how does /.*\n/{(.*\n)|.*\n(.*\n)|} match anything but the tautological .*\n|? for example, if the input is "line1\nline2\n", then . is in turn "line1\n" and "line2\n", and both match .*\n|. where do the actions go in your example?
I guess I botched the example a bit. The whole part after the @ should be in an x//, and the actions would come after. Something more complicated would allow you to match any parenthetical expression on a line and alter it, which could be useful.
- erik
