XOR vs. Hyper (was Re: Perl6 Operator List)

2002-10-27 Thread Michael Lazzaro

FWIW, if people are really eager to keep ^ for xor (I don't think
anything's clicking great as a replacement), we could of course switch
hyper to ~.  That would give us, in part:

   ? ! + - _ # unary prefixes
  
+ -  *  /  %  ** x xx# binary
+=-= *= /= %= **=x=xx=
   ~+~- ~* ~/ ~% ~**~x~xx# hyper
   ~+=   ~-=~*=~/=~%=~**=   ~x=   ~xx=

  and  or   xor   err# logical ops
 ||   ^^// # logical ops
  b   b|   b^   # binary (placeholders, for now)
  |^# binary or super (dunno, for now)
  all  any  one   none   # superpositional (+ sum,prod,cat,reduce)

That would put us back to square one with string cat, but it _would_
give people back their C-like xor, which would help the familiarity
issue a bit.


OR, we could use ~ for string and ~~ for hyper, which I think would be
OK except for the presence of an ~~~ operator for hypercat (it does sort
of look like a cat going really fast, though, doesn't it?)

We could also try for some bracketing constructs around hypers, or a
doubled punct, or something.  Thought of course about +, it looks very
hyper-like, but probably still too many issues with the old-style file $stuff

+ -  *  /  %  ** x xx# binary
+=-= *= /= %= **=x=xx=
   +   -*/%**   x   xx   # hyper
   +=  -=   *=   /=   %=   **=  x=  xx=

Dunno, just feels like there should be a solution here, somewhere...

 a ~~+  b   # not awful
 a +  b   # sigh, this is pretty nice looking
 a h+ b
 a + b
 a ^+^  b
 a `+   b
 a .+.  b
 a =+=  b
 a ~+~  b
 a \+\  b
 a [+]  b
 a h[+] b
 a [+] b
 a +   b

MikeL



Re: XOR vs. Hyper (was Re: Perl6 Operator List)

2002-10-27 Thread Luke Palmer
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Date: Sat, 26 Oct 2002 23:01:31 -0700
 From: Michael Lazzaro [EMAIL PROTECTED]
 X-Accept-Language: en,pdf
 Cc: Damian Conway [EMAIL PROTECTED],
   [EMAIL PROTECTED] [EMAIL PROTECTED]
 X-SMTPD: qpsmtpd/0.12-dev, http://develooper.com/code/qpsmtpd/
 
 
 FWIW, if people are really eager to keep ^ for xor (I don't think
 anything's clicking great as a replacement), we could of course switch
 hyper to ~.  That would give us, in part:

What about smart match, then?  Would that go back to =~ ? 

To be personally honest, my favorite (still) is:

^Hyper
\\   Xor
unary !  Not (screw parallelism: it was never there before)
~Cat
_ nada ahora
binary !  niente ora
~~   Smart match

I have no preferences for the bitops, as I don't find them remotely
useful in my work.

Modifying your table:
? ! + - _ # unary prefixes
   
 + -  *  /  %  ** x xx# binary
 +=-= *= /= %= **=x=xx=
^+^- ^* ^/ ^% ^**^x^xx# hyper
^+=   ^-=^*=^/=^%=^**=   ^x=   ^xx=
 
   and  or   xor   err# logical ops
  ||   \\// # logical ops
   b   b|   b\   # No biterr??!  :)
   |\# No superr either...
   all  any  one   none   # none?  Seriously :)?  Fun.

I dunno, that's just me.  The only problem with \\ is will people
remember which way is which?  It'd be a shame to see

$fh = open('/etc/passwd') \\ die Can't open /etc/passwd: $! 

And have it always die.  But honestly, that's not too much of a
problem.  A mnemonic might be that \\ has negative slope, and \\
kindof negates... kindof.  Well, forget that.

As for unary \, who cares?  ! is fine for negation. C didn't make the
connection, so why must we? 

Or we could make ! the reference op  8-P

Luke