in reply to my, my, my

I'd like to use the mathematical symbol ∃ to declare variables. Now that you mention it, the word "foreach" is a bit long and tedious, as well, and "while" isn't far behind. So I'd like to use ∀ for looping.

— John

Replies are listed 'Best First'.
Re: Re: my, my, my
by theorbtwo (Prior) on Nov 15, 2002 at 05:51 UTC

    Perl6 will let you, with operator-subs, and unicode-named subs. Of course, being able to type ∃ and ∀ is up to you. (You can do this in p5 with a source filter, but you might have trouble if you use ∃ or ∀ for other things in your code, and the filter isn't written correctly.

    Of course, you were joking, weren't you. Perl6 will allow implementation of all sorts of new jokes.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Doesn't Perl 5 allow Unicode in sub names, just as in any variable name?

      Those are math symbols, not "letters", so it won't match \W and would not be legal in identifiers, as things stand now.

      But I can certainly see the use for non-letter names of one character (similar to today's punctuation-mark names), as that will open up the math operators and other symbols.

        There's already example code out there with σ as an operator-sub, in exgisis 1, IIRC, so that will almost certianly work. I suspect the rule will end up being different for op-subs.

        And I'm fairly certian that p5 allows arb. unicode var. names, but not subnames, but I don't quite recall... I'd test, but I'm not at home.


        Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).