Type | Wish | Status | submitted | Date | 30-Mar-2015 21:56 |
---|---|---|---|---|---|
Version | r3 master | Category | Unspecified | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
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 to | n/a | Fixed in | - | Last Update | 30-Mar-2015 22:14 |
---|
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 | - |