[Kc] infix pointer question

David Nicol davidnicol at gmail.com
Thu Aug 31 16:20:38 PDT 2006


On 8/31/06, Eric Wilhelm <scratchcomputing at gmail.com> wrote:
>
> Another way to call it (or, more commonly, you want the value of a
> constant -- but we should be using Readonly now, right?), put a
> unary + before it.
>
> $ perl -wle 'sub f(){print "called f"; "thbbt" }; $h{+f} = 4; print keys %h'
> called f
> thbbt
>
> --Eric

unary plus not turning its argument into a number has always bothered me
a little.  It's a short way to say scalar(f) but it has some side effect such
that ~~ is preferred in golf -- perhaps simply that ~~ will not bind to whatever
is left of it and try to do addition.

~~, the double tilde, does bitwise xor on its argument, twice.

--
Although efforts have been taken to mitigate the problem, this message
may contain flippancy, hyperbole and/or confusing assertions.  Please
reply directly to davidnicol at gmail.com for clarification of any points
appearing unclear, vague, cruel, frustrating, threatening, negative,
dilletantish or otherwise unprofessional before taking action based on
misintepretation or misconstruction of such points: the world is
complex and we're all in it together.


More information about the kc mailing list