Adding print-style function calls, and preproc plugins

Tim Peters tim.one at home.com
Thu Aug 30 20:25:11 EDT 2001


[Steven D. Majewski]
> A *SLIGHT* ambiguity !
>
> It's extremely ambiguous.
>
> What does:
> 	"e1 e2 e3 e4 e5"
> mean when more than one of those e's is a function ?
> Can you tell which ones represent function calls if you don't
> know the value of all of the e's ?

Did you ever check out REBOL?  That's the case there:  it's kind of like
Scheme but with mixed infix/reverse-forth <0.5 wink> notation, and you
actually can't know at compile-time how it groups.  Something like

    probe copy/part next colors back tail colors

is fine (and, indeed, taken verbatim from the reference manual).  If colors
is bound to the list [red green blue], that produces [green].  At runtime it
actually groups like this:

    probe(
          copy/part(next(colors),
                    back(tail(colors))
                   )
         )

where "copy/part" is effectively a single name.

It's actually quite readable in simple cases, like

    print third colors

but in complex cases it really gave me a headache.  I was assured at least
once that the implementation wasn't always delighted either <wink>.





More information about the Python-list mailing list