http://qs321.pair.com?node_id=720701


in reply to Re: Previously unseen error in connection with -X functions
in thread Previously unseen error in connection with -X functions

Here's another way to see -e isn't a function:

I personally believe that it's too bad it isn't. Actually, it even seems one, not to mention that its documentation is available under perldoc -f -X! Of course Perl 6 knows better by making all operators actual functions. But I wouldn't dare asking that much in 5's realms: perhaps one difficulty in this sense is the new stacking facility la -f -w -x $file however AIUI from the docs that's just syntax fancy. Which I read in the sense that the parser takes care of it making it into the equivalent of -x $file && -w _ && -f _, but at this point ideally those tests may be overridden and without interfering at all with the additional magic, which would be completely orthogonal.

--
If you can't understand the incipit, then please check the IPB Campaign.

Replies are listed 'Best First'.
Re^3: Previously unseen error in connection with -X functions
by JavaFan (Canon) on Oct 31, 2008 at 14:30 UTC
    I think one of the reasons -f isn't a function is that it violates the naming rules. Identifier names have to start with letters, and dashes are not allowed. -f violates that. Changing it would probably mean changing the lexer. Which I don't think many people are willing to do.

    perhaps one difficulty in this sense is the new stacking facility la -f -w -x $file however AIUI from the docs that's just syntax fancy. Which I read in the sense that the parser takes care of it making it into the equivalent of -x $file && -w _ && -f _,
    I was under the impression that the stackability was archieved by -f and friends returning magical values. But if there's magic, if doesn't show with Devel::Peek::Dump, so I'm probably wrong in my impression.