metaeducation / rebol-issues

6 stars 1 forks source link

Clone_Function and the frame reference problem #2044

Open rebolbot opened 11 years ago

rebolbot commented 11 years ago

Submitted by: Ladislav

In the c-function.c file there is a Clone_Function function used when objects are cloned. Clone_Function creates a new function sharing both the spec and args values with the original func argument. This makes any of the spec and args values unsuitable to identify the function. Ticket #2025 demonstrates that the body value cannot identify the function either. R3 function values consist only of spec args and body values. Thus, there is nothing left to use as the frame reference value needed for function variables to identify the function to which they belong.

The solution proposed:

In my opinion, the best solution of the function frame reference problem in R3 is to adjust the Clone_Function implementation to copy the args value of the original func argument to make sure the args value identifies the function to which it belongs and to use the args value as the frame reference of function-local variables.

CC - Data [ Version: r3 master Type: Bug Platform: All Category: Datatype Reproduce: Always Fixed-in:none ]

rebolbot commented 11 years ago

Submitted by: Ladislav

In the core-tests suite.

rebolbot commented 11 years ago

Submitted by: Ladislav

Fixed by https://github.com/rebol/rebol/pull/122