REBOL3 tracker
  0.9.12 beta
Ticket #0002109 User: anonymous

Project:



rss
TypeBug Statusbuilt Date20-Feb-2014 18:33
Versionr3 master CategoryMezzanine Submitted byBrianH
PlatformAll Severityminor Prioritynormal

Summary FUNCTION and CLOSURE assume /local is the last refinement
Description FUNCTION and CLOSURE currently assume that /local is the last refinement. This isn't necessarily the case; it's possible to have other refinements after /local, and this is sometimes done by people who want to have hidden function options. But these generators just append the collected words onto the function spec, assuming that they will be added to the set that goes with /local. Until/if #2108 is implemented, this should be considered a problem.

Instead of appending the words, insert them between /local and the next refinement or the tail, whichever is found first. Or right after /local, if that's more efficient to find. Since /local is never supposed to be called (see #2108) the order or position of the words in the /local section shouldn't matter.

Affects FUNCTION and CLOSURE.
Example code
; Current behavior
>> print mold function [/local a /hidden] [b: 1]
make function! [[/local a /hidden b][b: 1]]

; Desired behavior, insert at next refinement proposal
>> print mold function [/local a /hidden] [b: 1]
make function! [[/local a b /hidden][b: 1]]

; Desired behavior, insert after /local proposal
>> print mold function [/local a /hidden] [b: 1]
make function! [[/local b a /hidden][b: 1]]

Assigned ton/a Fixed inr3 master Last Update4-Mar-2014 06:43


Comments
(0004257)
BrianH
20-Feb-2014 23:12

Fixed in https://github.com/rebol/rebol/pull/186 with the insert after /local method.

Date User Field Action Change
4-Mar-2014 06:43 BrianH Status Modified pending => built
20-Feb-2014 23:12 BrianH Comment : 0004257 Modified -
20-Feb-2014 23:12 BrianH Comment : 0004257 Added -
20-Feb-2014 23:11 BrianH Fixedin Modified => r3 master
20-Feb-2014 23:11 BrianH Status Modified submitted => pending
20-Feb-2014 18:37 BrianH Description Modified -
20-Feb-2014 18:36 BrianH Description Modified -
20-Feb-2014 18:36 BrianH Code Modified -
20-Feb-2014 18:33 BrianH Ticket Added -