in reply to Re: my, my, my
in thread my, my, my

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).

Replies are listed 'Best First'.
Re: Re: Re: my, my, my
by John M. Dlugosz (Monsignor) on Nov 15, 2002 at 15:36 UTC
    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).

        Unicode sub names are fine.

        But, I discovered something else: my doesn't work right. With strict, I get an error that "global $α requires explicit package name" on the line that declares it lexical!

        Without strict, it compiles, and the other code shows that it is indeed lexical.

        #use strict; use warnings; use utf8; my $α= 5; my $Φ= 4; sub Φ { return $Φ; } package XX; $main::Φ= 33.33333; package main; print Φ;
        —John

        Be sure to view as UTF-8 in your browser.

        Cross reference: Unicode source code problem in 5.6.1.