Type | Wish | Status | reviewed | Date | 7-Mar-2013 17:09 |
---|---|---|---|---|---|
Version | r3 master | Category | Mezzanine | Submitted by | Ladislav |
Platform | All | Severity | minor | Priority | normal |
Summary | Identity function |
---|---|
Description | #626 already describes one identity function using unevaluated argument. However, my experience is telling that it is useful to have a similar function with evaluated argument. |
Example code |
identity: func [ "Returns the value passed to it." value [any-type!] ] [ :value ] |
Assigned to | n/a | Fixed in | - | Last Update | 5-Mar-2014 08:45 |
---|
Comments | |
---|---|
(0003590)
BrianH 7-Mar-2013 18:07 |
It seems like it would be pretty rarely used, mostly as a function value in general transformation operations. Maybe giving it the full name IDENTITY would be more appropriate, both because it would be easier to remember what it does when seeing it in code, and as a Huffman-coding approach to names. If you don't see functions often it can be harder to read the code without having to backtrace or use HELP, so not abbreviating the name can make things easier. ID seems more like the name of a user function or variable. |
(0003591)
Ladislav 7-Mar-2013 18:22 |
" Maybe giving it the full name IDENTITY would be more appropriate" - I am OK with that |
Date | User | Field | Action | Change |
---|---|---|---|---|
5-Mar-2014 08:45 | BrianH | Status | Modified | submitted => reviewed |
9-Mar-2013 02:35 | Ladislav | Category | Modified | Unspecified => Mezzanine |
7-Mar-2013 19:28 | Ladislav | Description | Modified | - |
7-Mar-2013 19:26 | Ladislav | Code | Modified | - |
7-Mar-2013 18:22 | Ladislav | Comment : 0003591 | Added | - |
7-Mar-2013 18:09 | BrianH | Comment : 0003590 | Modified | - |
7-Mar-2013 18:08 | BrianH | Comment : 0003590 | Modified | - |
7-Mar-2013 18:07 | BrianH | Comment : 0003590 | Added | - |
7-Mar-2013 17:11 | Ladislav | Description | Modified | - |
7-Mar-2013 17:11 | Ladislav | Code | Modified | - |
7-Mar-2013 17:09 | Ladislav | Ticket | Added | - |