Type | Bug | Status | tested | Date | 31-Jul-2009 09:00 |
---|---|---|---|---|---|
Version | alpha 76 | Category | Native | Submitted by | Sunanda |
Platform | All | Severity | minor | Priority | normal |
Summary | ALIAS 'a "b" assigns the previous value of b to a in a's bound context |
---|---|
Description |
ALIAS in R2 _only_ allows string! for the new name: a: 1 alias 'a "a!" == a! >> alias 'a 'a* ** Script Error: alias expected name argument of type: string ** Near: alias 'a 'a* **** R3 appears to allow both string! and word!, but the second looks very broken: a: 1 alias 'a "a!" a! == 1 ;; string has been correctly aliased alias 'a 'a* a* ;; word has not been aliased ** Script error: a* has no value a! ;; worse: the stringed alias had disappeared ** Script error: a! has no value a ;; worse still: the word itself has vanished ** Script error: a has no value **** Only the trivial case seems to work: >a: 1 == 1 alias 'a 'a == a a == 1 |
Example code |
Assigned to | n/a | Fixed in | alpha 111 | Last Update | 26-Feb-2011 01:13 |
---|
Comments | |
---|---|
(0001443)
BrianH 31-Jul-2009 16:37 |
After some testing (based on the example code in #1164), it appears that the real bug is that the value previously assigned to the word passed as the second parameter is then assigned to the word passed as the first parameter in its bound context. If the second word was previously unset, that unset! value is propagated to the first word. Summary changed accordingly. Here'a some code that proves it:
>> a: 1 == 1 >> b: 2 == 2 >> alias 'a 'b == b >> a == 2 ; should be 1 Note that ALIAS only changes the value of the first word in its bound context, so aliases of system words in user scripts (or isolated modules) only change the value in the user context (or module context), not in the system context. |
(0001511)
Carl 19-Aug-2009 23:45 |
It looks like the bug is in RESOLVE, not in ALIAS. Essentially, the problem is that to type a line with 'b causes RESOLVE to add 'b to the current context. So, now it has been defined, and even though it is unset, creating an alias becomes problematic.
The fix is to not allow a word as the second argument. Same as R2. |
(0001555)
BrianH 21-Aug-2009 19:41 |
That is good since it makes the problem much less important (it only affects aliases that differ in spelling rather than case), but the behavior is still there. Changed the summary to reflect the current behavior:
>> a: 1 == 1 >> b: 2 == 2 >> alias 'a "b" == b >> a == 2 ; should be 1 If this is too tricky to fix, we can just say "Well, don't do that then." and dismiss the ticket. |
(0003069)
BrianH 31-Jan-2011 06:16 |
The ALIAS function has been removed in alpha 111. See #1835 for details. |
Date | User | Field | Action | Change |
---|---|---|---|---|
26-Feb-2011 01:13 | BrianH | Status | Modified | built => tested |
31-Jan-2011 06:18 | BrianH | Comment : 0003069 | Modified | - |
31-Jan-2011 06:16 | BrianH | Comment : 0003069 | Added | - |
31-Jan-2011 06:15 | BrianH | Status | Modified | reviewed => built |
31-Jan-2011 06:15 | BrianH | Fixedin | Modified | => alpha 111 |
21-Aug-2009 20:18 | BrianH | Comment : 0001555 | Modified | - |
21-Aug-2009 20:17 | BrianH | Fixedin | Modified | alpha 79 => none |
21-Aug-2009 19:41 | BrianH | Comment : 0001555 | Added | - |
21-Aug-2009 19:37 | BrianH | Status | Modified | tested => reviewed |
21-Aug-2009 19:37 | BrianH | Summary | Modified | ALIAS 'a 'b assigns the previous value of b to a in a's bound context => ALIAS 'a "b" assigns the previous value of b to a in a's bound context |
21-Aug-2009 19:33 | BrianH | Status | Modified | built => tested |
20-Aug-2009 00:13 | carl | Status | Modified | reviewed => built |
20-Aug-2009 00:13 | carl | Fixedin | Modified | => alpha 79 |
20-Aug-2009 00:13 | carl | Comment : 0001511 | Modified | - |
19-Aug-2009 23:45 | carl | Comment : 0001511 | Added | - |
31-Jul-2009 17:03 | BrianH | Comment : 0001443 | Modified | - |
31-Jul-2009 16:54 | BrianH | Summary | Modified | ALIAS 'word-a 'word-b unsets word-a in its bound context => ALIAS 'a 'b assigns the previous value of b to a in a's bound context |
31-Jul-2009 16:37 | BrianH | Comment : 0001443 | Added | - |
31-Jul-2009 16:32 | BrianH | Summary | Modified | ALIAS 'word-a 'word-b unsets word-a in the current context => ALIAS 'word-a 'word-b unsets word-a in its bound context |
31-Jul-2009 16:30 | BrianH | Summary | Modified | ALIAS acts as UNSET => ALIAS 'word-a 'word-b unsets word-a in the current context |
31-Jul-2009 16:27 | BrianH | Status | Modified | submitted => reviewed |
31-Jul-2009 16:27 | BrianH | Description | Modified | - |
31-Jul-2009 09:00 | sunanda | Ticket | Added | - |