REBOL3 tracker
  0.9.12 beta
Ticket #0002213 User: anonymous

Project:

Previous Next
rss
TypeWish Statussubmitted Date30-Mar-2015 21:56
Versionr3 master CategoryUnspecified Submitted byfork
PlatformAll Severityminor Prioritynormal

Summary Eliminate AND~, OR~, XOR~ prefix variants in favor of ALL, ANY, and new ONE
Description In the audience-favorite ticket #1879, it is proposed that the operations AND, OR, and XOR become "conditional" (to match NOT). Ladislav explains what that means in the post. This would mean the bitwise operators become the very nice and general words INTERSECT, UNION, DIFFERENCE and COMPLEMENT.

There was a question of what to do with prefix AND~, OR~, and XOR~. Here's an idea: get rid of them. They have ugly names. Instead teach people ALL, ANY, and add a new member to that collection: ONE. If only one of its arguments were true, it returns that argument...otherwise NONE. (Another naming possibility could be SINGLE...which would leave the doors open for MULTIPLE which could return a block of values if there was more than one true value.)

>> one [1 false 2]
== none

>> one [false false 2]
== 2

This would in its baseline case serve as a replacement for prefix XOR if you supplied it with two values, and have applications beyond that.

BUT the most important reason to kill AND~, OR~ and XOR~ is that it opens the door for a more interesting convention for what ending in tilde means by convention than "mutate infix operator into prefix form". That is a waste of the possibility. (Other suggestions were "creation functions" like object~ instead of object... which might be better as ~object to let tilde mean MAKE.)

Note: Although a prefix NOT exists, it would/should return a false/none on a block. This suggests maybe a ZERO would be useful for ensuring that everything in a block is false...which isn't quite the same thing as NOT ALL [...] because it wouldn't short-circuit.)
Example code

			

Assigned ton/a Fixed in- Last Update30-Mar-2015 22:14


Comments

Date User Field Action Change
30-Mar-2015 22:14 Fork Description Modified -
30-Mar-2015 22:13 Fork Description Modified -
30-Mar-2015 22:09 Fork Description Modified -
30-Mar-2015 21:56 Fork Ticket Added -