Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: Half-serious quest for prefix anonymous refs takingby blazar (Canon) |
on May 31, 2008 at 09:51 UTC ( [id://689409]=note: print w/replies, xml ) | Need Help?? |
After rereading your post, I realize all you asking for was a indirect-object syntax for list constructors equivalent to the indirect-object syntax for list operators such as print and join. I personally believe that either you should reread my posts again or that I have terribly serious expressive problems for all that I "want" (please, notice the quotes) is a prefix operator that creates an anonymour arrayref or hashref out of a list, alternative to the currently existing circumfix ones: [] and {}. For completeness and consistency, I'm also asking the same thing wrt subrefs and scalar refs. Thus, instead of:
I would like, say:
Except that this would clash with current Perl syntax, since perl would try to parse e.g. the construct in the first line like a reference to the @< variable, and similarly for the others. Thus I'm asking about your own ideas for a good syntax: [] and {} only take two charachters, and I would like something just as lightweight; in addition the operators should intuitively and immediately suggest the kind of reference that they create, hence my idea of somehow using sigils. I'm not asking this out of a practical need, but just for fun and brainstorming. (But if a very good suggestion pops out, maybe...)
In Section
Meditations
|
|