Python Macros
gabriele renzi
rff_rff at remove-yahoo.it
Wed Oct 6 06:33:07 EDT 2004
Alex Martelli ha scritto:
>
> Assuming all of these identifiers are just such, you can't use the
> latter syntax sugar (nor could you use the shorter 'stuff oper' sugar
> either even without the << tail), but just tweak the syntax sugar
> slightly (e.g. put a dot between the identifiers, which syntactically
> you can't just juxtapose -- or, insert some operator there) and I'd
> expect you can build whatever weird semantics you intend to (whether it
> would make any _SENSE_ to go to such contortions is another issue, of
> course -- not knowing what semantics you expect to associate to this not
> exactly self-documenting syntax, I can't really guess).
>
thanks for hinting the dot, I'm not going to implement this, just
thought this what was the OP was asking. I still don't understand what
he wants.
The syntax is perl6's one, and I bet you find it confusing :) but no
more than F-Script's one:
x @foo: @y
But see, OOPAL or HOM or HyperOperations are a nifty thing and yes, I
actually think they make lot of sense. I'd love to see them in python.
I think you can google for it and you'll find papers explaining it
better than I can, but basically it boils down to applying operations to
a whole collection at once, in APL style.
More information about the Python-list
mailing list