Permalink
Browse files

Merge pull request #186 from BrianHawley/fix-2109-function-local-not-…

…at-end

Fixes FUNCTION and CLOSURE when /local not last refinement
  • Loading branch information...
2 parents 5d0a9b4 + a155f6a commit 25033f897b2bd466068d7663563cd3ff64740b94 @carls carls committed Mar 4, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/mezz/base-funcs.r
  2. +1 −1 src/mezz/mezz-func.r
@@ -41,7 +41,7 @@ function: funct: func [
body: copy/deep body
; Collect all set-words in the body as words to be used as locals, and add
; them to the spec. Don't include the words already in the spec or object.
- append spec collect-words/deep/set/ignore body either with [
+ insert find/tail spec /local collect-words/deep/set/ignore body either with [
; Make our own local object if a premade one is not provided
unless object? object [object: make object! object]
bind body object ; Bind any object words found in the body
@@ -35,7 +35,7 @@ closure: func [
body: copy/deep body
; Collect all set-words in the body as words to be used as locals, and add
; them to the spec. Don't include the words already in the spec or object.
- append spec collect-words/deep/set/ignore body either with [
+ insert find/tail spec /local collect-words/deep/set/ignore body either with [
; Make our own local object if a premade one is not provided
unless object? object [object: make object! object]
bind body object ; Bind any object words found in the body

0 comments on commit 25033f8

Please sign in to comment.