|Version||alpha 111||Category||Native||Submitted by||BrianH|
|Summary||MAKE object object doesn't rebind functions|
When making an object from an object prototype and object spec, functions in the result are not rebound, they are the same as the original. In contrast, when using an object prototype and a block spec, the functions are rebound. Rebinding seems like the more expected behavior.
Note: In R2, they are rebound in both cases.
Originally noticed by Bolek, reported in AltME.
; The prototype context >> a: context [f: does [print b] b: none] == make object! [ f: make function! [[print b]] b: none ] ; Making an object based on the proto and an object spec >> c: context [b: 1] == make object! [ b: 1 ] >> a1: make a c == make object! [ f: make function! [[print b]] b: 1 ] >> a1/f none ; expected 1 >> same? :a/f :a1/f == true ; expected false ; For comparison, making an object based on the proto and a block spec >> a2: make a [b: 1] == make object! [ f: make function! [[print b]] b: 1 ] >> a2/f 1 >> same? :a/f :a2/f == false
|Assigned to||n/a||Fixed in||r3 master||Last Update||19-Feb-2014 21:33|
|You can work around this by converting the object spec to a block with TO-BLOCK or BODY-OF. Is it a benefit to have the different behaviors available? It's certainly confusing to people who don't expect it.|
This is a "multiple inheritance" case. Thus, it is a complicated matter and no wonder it is not done right when even the single inheritance is having issues.
At the time of this writing it is not true that when make object block is evaluated the functions are truly rebound as #2045 (which is the single inheritance issue) demonstrates.
|In the core-tests suite.|
|Fixed by https://github.com/rebol/rebol/pull/139|
|22-Feb-2014 18:20||Ladislav||Comment : 0003926||Modified||-|
|19-Feb-2014 21:33||BrianH||Fixedin||Modified||=> r3 master|
|19-Feb-2014 21:33||BrianH||Status||Modified||pending => built|
|30-Aug-2013 01:52||Ladislav||Severity||Modified||minor => major|
|28-Aug-2013 14:33||Ladislav||Status||Modified||reviewed => pending|
|28-Aug-2013 14:33||Ladislav||Comment : 0003952||Added||-|
|15-Aug-2013 15:09||Ladislav||Comment : 0003929||Added||-|
|15-Aug-2013 11:42||Ladislav||Comment : 0003926||Modified||-|
|15-Aug-2013 11:31||Ladislav||Comment : 0003926||Modified||-|
|15-Aug-2013 11:26||Ladislav||Comment : 0003926||Modified||-|
|15-Aug-2013 11:22||Ladislav||Comment : 0003926||Added||-|
|20-Mar-2011 03:03||carl||Status||Modified||submitted => reviewed|
|3-Mar-2011 21:12||BrianH||Comment : 0003139||Added||-|