[ZPT] Re: v2 of Path Prefixes in CVS

Charlie Clark charlie at begeistert.org
Tue Sep 16 10:15:23 EDT 2003


On 2003-09-13 at 01:25:52 [+0000], Evan Simpson wrote:
> Minor brainstorm -- you may hate it or love it.
> 
> Someone (Fergal?) suggested adding parens to the 'call:' prefix syntax. 
>   I have to admit that "here/method/call:(x, y)" looks better to me than 
> plain "here/method/call:x, y".  It occurred to me that we could do 
> "better".

I think it might have be me actually as I really don't get these prefixes.

> Suppose we allow prefixed path segments to have the form ":Xarg", where X 
> is a punctuation character (other than '/', of course).  This would refer 
> to a prefix named 'X' with argument 'arg' -- that is, in the expression 
> "here/:#foo" the prefix is '#', in "here/?bar" it is '?', and in 
> "here/method/:(x, y)" it is '('!
> 
> With this capability, we could define the following (the prefix 
> implementation can enforce the matching delimiter in the first three 
> cases):
> 
> ":(x, y)" == "call:x,y"
> ":{k}"    == "key:k"
> ":[1]"    == "index:1"
> ":=x"     == "var:x"
> 
> Too weird?  Too Perlish?  Well, at least it's out of my head.

Written like that it looks fine. I won't join Chris' literate criticism but 
what I personally need are examples of real world code using the various 
alternatives. Shane threw in a few samples to make my head spin and reach 
for sick bag where the prefix (at least the I think the punctuation is the 
prefix) is variable. Maybe a stupid question but why should such prefixes 
be variable. Second stupid question: while the four lines above look nice 
to someone like me who's happy to insist that TAL is quintessentially 
Pythonic, I thought there was supposed to decoupling.

Sorry for my lack of understanding.

Charlie



More information about the ZPT mailing list