in reply to Re^2: Unicode infinity
in thread Unicode infinity

That's exactly what inf does.

$ perl -MO=Concise,-exec -Mv5.40 -Mbuiltin=inf -e'my $x = inf;' Built-in function 'builtin::inf' is experimental at -e line 1. 1 <0> enter v 2 <;> nextstate(main 9 -e:1) v:us,*,&,{,$,fea=8 3 <$> const[NV Inf] s 4 <1> padsv_store[$x:9,10] vKS/LVINTRO 5 <@> leave[1 ref] vKP/REFC -e syntax OK

Replies are listed 'Best First'.
Re^4: Unicode infinity
by NERDVANA (Priest) on Jul 02, 2024 at 05:02 UTC
    Right, they have the same outcome, just different ways to arrive there.

      In entirely friendly attitude: I can't stand gnu error messages containing unicode for ellipses and quotes. It's really a pollution. So, In general I am against polluting the language with non-ascii symbols. And my language's alphabet is entirely non-ascii. Let python be the winner in this battle. I think you opened a can of worms :) next will be <= and >= and what about thumbs-up for if(👍 $x){}. And gotos will become again popular just for the sake of goto 😭 Anyway, I should have said that earlier.

      bw, bliako

          I think you opened a can of worms :) next will be <= and >= and what about thumbs-up for if(👍 $x){}.

        If you can do this:

        perl -Mutf8 -wle 'use constant π=>3.141;use overload "sqrt"=>\&sr;sub sr{sqrt shift}print sr π'
        1.77228665852903
        
        This seems reasonable:
        perl -Mutf8 -wle 'use constant π=>3.141;use overload "sqrt"=>\&√;sub √{sqrt shift}print √π'    
        Unrecognized character \x{221a}
        
        But, I like this can of worms :-)

        Don't forget ≠ ! I already added them to Language::FormulaEngine and rather enjoy them in the webapp I built with that.