Type | Wish | Status | reviewed | Date | 28-Jan-2009 04:04 |
---|---|---|---|---|---|
Version | alpha 32 | Category | n/a | Submitted by | ptretter |
Platform | All | Severity | minor | Priority | low |
Summary | Expand support of switch to support type logic! |
---|---|
Description | Would like to see switch native support logic! values as its value argument. |
Example code |
item: true switch item [ true [print "Item is TRUE"] false [print "Item is FALSE"] none [print "Item is NONE"] ] >>Item is TRUE |
Assigned to | n/a | Fixed in | - | Last Update | 28-Jan-2009 04:24 |
---|
Comments | |
---|---|
(0000383)
BrianH 28-Jan-2009 04:23 |
SWITCH does support logic! and none! values, but your example had no logic! or none! values in the choice list, just words. You need to use literal logic! and none! values:
switch item [ #[true] [print "Item is TRUE"] #[false] [print "Item is FALSE"] #[none] [print "Item is NONE"] ] It has been suggested recently that SWITCH recognize the words that correspond to the datatypes as being the datatypes, saving you from needing to use type?/word. We may be able to add these words as well to that suggestion. Discuss this in R3 chat. |
Date | User | Field | Action | Change |
---|---|---|---|---|
28-Jan-2009 04:24 | BrianH | Code | Modified | - |
28-Jan-2009 04:24 | BrianH | Status | Modified | submitted => reviewed |
28-Jan-2009 04:23 | BrianH | Comment : 0000383 | Added | - |
28-Jan-2009 04:04 | ptretter | Ticket | Added | - |