Mark J. Reed wrote:
> I do quite like the magical postfix %, but I wonder how far it should
> go beyond ±:
>
> $x += 5%;   # becomes $x += ($x * .05)?  Or maybe $x *= 1.05  ?
> $x * 5%;   # becomes $x * .05 ?

If it works with ±, it ought to work with + and -.  Rule of thumb: if
there's no easy way to answer "5% of what?" then default to "5% of
1.0", or 0.05.  +, -, and ± would need to be set up to provide the
necessary answer for "of what?" by means of setting Whatever; and by
basing it on Whatever, you have other options, such as:

    @a[50%] # accesses the middle item in the list, since Whatever is
set to the length of the list.

--

Concerning "-> $val, $err { [..^] $val - $err, $val + $err }" vs "->
$val, $err { any $val - $err, $val + $err }": I'm not sold on the
notion that Huffman coding might imply that ± should go with the
former.  Perhaps an argument can be made for it; but I suspect that
the relative commonness of the two uses is extremely similar (which,
per Huffman coding, would imply that their names should have similar
lengths).  Whichever one we go with, we have a conundrum: if we use ±
as the name of the latter, the conundrum is that the only other
intuitive name for the former that has thus far been proposed (i.e.,
"within") is too long; if we use ± as the name for the former, the
conundrum is that no other intuitive name has been proposed for the
latter.

So: what we need are proposals for short, understandable names for
each operator.  Suggestions?

-- 
Jonathan "Dataweaver" Lang

Reply via email to