Ticket #4 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Func should return binded blocks

Reported by: jvargas Owned by: krobillard
Priority: major Milestone:
Component: Orca Version:
Keywords: closure Cc:

Description

Func supports most of the closure behaviours properly. However in the following example it fails causing an interpreter crash.

relation: func [value [integer!] /local f-value][
   f-value: 2 * value
   return [value f-value]
]

result: relation 2
print second result ;== f-value

reduce result ;; BUS ERROR

Change History

Changed 2 years ago by krobillard

  • status changed from new to closed
  • resolution set to fixed

With changeset:140, function arguments are now copied to the function context unless recursion is in progress. This results in more Rebol-like closure behavior, but is still an incomplete implementation. Returning local values from a recursive function will still crash the interpreter.

Note: See TracTickets for help on using tickets.