--- Ton Hospel <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] 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 trick. Phil ===== -- "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 http://sbc.yahoo.com
