On Sun, Sep 22, 2002 at 01:39:29PM -0500, Me wrote:
> So, how about something like:
>
> : # lock in current atom, ie as now
> :] # lock in surrounding group, currently ::
> :> # lock in surrounding rule, currently :::
> :/ # lock in top level rule, currently <commit>
> :// # cut
I kinda like it, since :: and ::: look very similar to me, too. (I
don't buy the syntax highlighting argument, partly because I often
encounter code in b&w printouts, perlmonks, or wherever.) Though I'd
probably prefer <cut> stayed <cut>. And those mismatched brackets
bother me, too. What about
: -> :
:: -> :[] or [:]
::: -> :<> or <:>
<commit> -> :// or /:/
<cut> -> :<cut> or :cut or <:cut> or just stay <cut>
Then again, I've never been convinced of the similarity between : and
::. To me, a single colon is modifying another operation, so it's like
the ? non-greedy modifier. Is that incorrect? Everything else does
something when backtracked over; the only thing : has in common with
them is that it has something to do with backtracking.
Btw, is /:/ ambiguous? I can't remember if there's any way a /pattern/
can be followed by a colon.
Staring at the third column above, I can't help wondering if [:cut],
<:cut>, and /:cut/ would all be useful. But not enough to really think
about it and figure out what they would mean, exactly -- my brain and
<cut> are still having some marital difficulties.
> Thus, redoing a couple examples from synopsis 5:
>
> m:w/ [ if :] <expr> <block>
> | for :] <list> <block>
> | loop :] <loop_controls>? <block>
> ]
>
> rule subname {
> ([<alpha>|_] \w*) :/ { fail if %reserved{$1} }
> }
> m:w/ sub <subname>? <block> /
m:w/ [ if :[] <expr> <block>
| for :[] <list> <block>
| loop :[] <loop_controls>? <block>
]
rule subname {
([<alpha>|_] \w*) :// { fail if %reserved{$1} }
}
m:w/ sub <subname>? <block> /
or
m:w/ [ if [:] <expr> <block>
| for [:] <list> <block>
| loop [:] <loop_controls>? <block>
]
rule subname {
([<alpha>|_] \w*) /:/ { fail if %reserved{$1} }
}
m:w/ sub <subname>? <block> /