develooper Front page | | Postings from July 2002

Re: more minigolf

Thread Previous | Thread Next
Phil Carmody
July 12, 2002 01:24
Re: more minigolf
Message ID:

--- Ton Hospel <> wrote:
> In article
> <>,
> writes:
> >> Does anyone else want to claim a golf trick?
> I claim:
>   $|-- and --$| as toggle.
>   ~- as a prefix -1 construct (e.g. in ~-pop)
> I would be surprised if these weren't known
> before, but at least I discovered them independently.

The latter's very well known by anyone who's done low level bit
twiddling in x86, for example. 
The relation 
  -x = ~x+1
is implicit in the definition of a twos-complement architecture.
Rearrange and substitute for 
  ~-x = x-1

My solution to the latest mini-golf included it, I think I used it
because I wanted a _high precedence_ decrement, higher precedence
than a simple subtraction. Both of the unary operators dominate most
other operators' precendence. 
So I'd call it a high-precedence -1 trick rather than a prefix -1


"One cannot delete the Web browser from KDE without
losing the ability to manage files on the user's own
hard disk." - Prof. Stuart E Madnick, MIT. 
So called "expert" witness for Microsoft. 2002/05/02

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About