{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5e8aa7d026c366d926dac86900bd0631?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5e8aa7d026c366d926dac86900bd0631","url":"https://api.github.com/users/davidcourtney","login":"davidcourtney","id":1019134},"updated_at":"2011-11-17T03:12:56Z","assignee":null,"labels":[],"closed_at":null,"comments":1,"url":"https://api.github.com/repos/kevinbirch/Djinn/issues/7","body":"# Setup\r\nIn the following example I define a function dipinc that adds one to the second item in the stack.\r\n\r\n\\[dipinc drop 1 add top' \\top' [id]]\r\n\r\n## Expected\r\nUser> __10 20 dipinc__\r\nstack: 11 20\r\n\r\nUser> __30 40 dipinc__\r\nstack: 11 20 31 40\r\n\r\n## Actual Result\r\nUser> __10 20 dipinc__\r\nstack: 11 20\r\n\r\nUser> __30 40 dipinc__\r\nstack: 11 20 31 20\r\n\r\nThe value of top' appears to be set to 20 on the first call and does not change on subsequent calls.\r\n","html_url":"https://github.com/kevinbirch/Djinn/issues/7","title":"Function Declarations are set the first time a function is called and do not change on subsequent calls.","number":7,"id":2264781,"created_at":"2011-11-17T02:43:01Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/07b0ab75f898ac5a6ff36c166a7f881c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"07b0ab75f898ac5a6ff36c166a7f881c","url":"https://api.github.com/users/kevinbirch","login":"kevinbirch","id":658345},"updated_at":"2011-11-17T03:12:56Z","url":"https://api.github.com/repos/kevinbirch/Djinn/issues/comments/2771597","body":"Yeah, I actually had a todo item about this.  This is caused by the implementation of declarations, they cache their results so they can be executed multiple times within a function.  I think the Declaration interface needs a method like initialize() that will set up the cache, and then execute would just return it.  Then, in the execute() method of ModuleFunction, it would call that new method instead of execute().  The execute() method would be called later when the word for that declaration was evaluated.\r\n\r\nWould you like to fix it?","id":2771597,"created_at":"2011-11-17T03:12:56Z"}}