in reply to Unicode infinity
It's a little misleading to claim that the first snippet works. Enable strict and you get
$ perl -Mv5.40 -e'my $x= Inf; say $x' Bareword "Inf" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.
So we're talking about barewords, and barewords can only start with a subset of word characters. "∞" isn't a word character.
Does anyone else feel like this ought to get fixed? How likely is a patch for this to get accepted?
What fix are we talking about?
Changing the definition of bareword to include some symbols? Absolutely not.
Changing the type of character ∞ is in Perl to be different than in Unicode? Absolutely not.
Changing the definition of type of character ∞ is in Unicode? Absolutely not.
Perhaps you meant to compare to builtin::inf. It was added in 5.40, and it's still experimental, but I expect it to be imported by use v5.xx in the future. Adding ∞ as an alias for that is a completely different story. That would make more sense, and is entirely feasible.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unicode infinity
by NERDVANA (Priest) on Jul 01, 2024 at 20:33 UTC | |
by ikegami (Patriarch) on Jul 02, 2024 at 02:57 UTC | |
by NERDVANA (Priest) on Jul 02, 2024 at 05:02 UTC | |
by bliako (Abbot) on Jul 02, 2024 at 10:56 UTC | |
by Anonymous Monk on Jul 02, 2024 at 14:19 UTC | |
| |
by NERDVANA (Priest) on Jul 02, 2024 at 20:17 UTC |