Front page | perl.perl6.internals |
Postings from July 2002
Re: we need more ops.
From: Eric Kidder
July 29, 2002 13:06
Re: we need more ops.
Message ID: Pine.LNX.email@example.com
On Mon, 29 Jul 2002, Nicholas Clark wrote:
> [Maybe we should have a competition to suggest the most crazy three character
> operator - ie state your sequence of three characters (not necessarily ASCII,
> but it helps), state their name, and state their purpose (including whether
> listop, binop, uniop, precedence, associativity or whatever else helps make
> your entry more humorous. So presumably there could be a :-) operator, but
> offhand I can't think of something plausible it could do. And does the
> tie-fighter need an X-wing operator to complement it? (not sure what that
> one would look like, let alone what it would do)]
:-) the Positivity operator ("happy face")
On the left-hand side of an expression, it tests whether the
expression contains a positive value. On the right-hand side, it
transforms the results of the expression into a positive value.
How it does this is implementation dependent.
This operator has right-hand side precendence.
Other operators in this vein are :-(, the "Negativity" operator, and :-|,
the "Zero" operator.
print :-) "-1"; # prints "0"
print "-1" :-); # prints some positive value, probably "1"
print -1 :-( :-) :-|; # prints some zero value, probably "0"
What we really need are see no evil, hear no evil, speak no evil
And on a complete aside, here is something I dug up in 'fortune'. Some of
these are actually useful!
Proposed Additions to the PDP-11 Instruction Set:
BBW Branch Both Ways
BEW Branch Either Way
BBBF Branch on Bit Bucket Full
BH Branch and Hang
BMR Branch Multiple Registers
BOB Branch On Bug
BPO Branch on Power Off
BST Backspace and Stretch Tape
CDS Condense and Destroy System
CLBR Clobber Register
CLBRI Clobber Register Immediately
CM Circulate Memory
CMFRM Come From -- essential for truly structured programming
CPPR Crumple Printer Paper and Rip
CRN Convert to Roman Numerals
DC Divide and Conquer
DMPK Destroy Memory Protect Key
DO Divide and Overflow
EMPC Emulate Pocket Calculator
EPI Execute Programmer Immediately
EROS Erase Read Only Storage
EXCE Execute Customer Engineer
HCF Halt and Catch Fire
IBP Insert Bug and Proceed
INSQSW Insert into queue somewhere (for FINO queues [First in never out])
PBC Print and Break Chain
PDSK Punch Disk
PI Punch Invalid
POPI Punch Operator Immediately
PVLC Punch Variable Length Card
RASC Read And Shred Card
RPM Read Programmers Mind
RSSC reduce speed, step carefully (for improved accuracy)
RTAB Rewind tape and break
RWDSK rewind disk
RWOC Read Writing On Card
SCRBL scribble to disk - faster than a write
SLC Search for Lost Chord
SPSW Scramble Program Status Word
SRSD Seek Record and Scar Disk
STROM Store in Read Only Memory
TDB Transfer and Drop Bit
WBT Water Binary Tree