{"action":"closed","issue":{"number":1783,"created_at":"2011-10-20T22:48:13Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hello, I'm getting started with CS so I'm reading SmoothCoffeeScript and doing the exercises from it.\r\nI've encountered this small issue:\r\n\r\nI have this function with another function inside, and according to what I have read, its valid CS:\r\n\r\n```\r\nextractFootnotes = (paragraphs) ->\r\n\tfootnotes = []\r\n\tcurrentNote = 0\r\n\treplaceFootnote = (fragment) ->\r\n\t\tif fragment.type = \"footnote\"\r\n\t\t\tcurrentNote++\r\n\t\t\tfootnotes.push fragment\r\n\t\t\tfragment.number = currentNote\r\n\t\t\ttype:\"reference\", number: currentNote\r\n\t\telse\r\n\t\t\tfragment\r\n\tforEach paragraphs, (paragraph) -> \r\n\t\tparagraph.content = map paragraph.content, replaceFootnote\t\t\r\n\t\r\n\tfootnotes\r\n```\r\nBut then I get this error:\r\n\r\n```\r\nReferenceError: footnotes is not defined\r\n    at /Users/ezequieldariogambaccini/Documents/CoffeScript/Books/Smooth-CoffeeScript/src-no-solutions/recluse.coffee:57:5\r\n    at /Users/ezequieldariogambaccini/Documents/CoffeScript/Books/Smooth-CoffeeScript/src-no-solutions/recluse.coffee:13:16\r\n    at /Users/ezequieldariogambaccini/Documents/CoffeScript/Books/Smooth-CoffeeScript/src-no-solutions/recluse.coffee:97:21\r\n    at Object.<anonymous> (/Users/ezequieldariogambaccini/Documents/CoffeScript/Books/Smooth-CoffeeScript/src-no-solutions/recluse.coffee:123:16)\r\n    at Object.<anonymous> (/Users/ezequieldariogambaccini/Documents/CoffeScript/Books/Smooth-CoffeeScript/src-no-solutions/recluse.coffee:125:4)\r\n    at Module._compile (module.js:402:26)\r\n    at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:57:25)\r\n    at /usr/local/lib/node_modules/coffee-script/lib/command.js:147:29\r\n    at /usr/local/lib/node_modules/coffee-script/lib/command.js:115:26\r\n    at [object Object].<anonymous> (fs.js:107:5)\r\n```\r\n(line 57 would be footnotes.push)\r\nI think it is a matter of scope, but I thought that footnote would behave like a global to replaceFootnote.\r\n","comments":1,"title":"Reference error of a variable whithin a function scope from another function scope","updated_at":"2011-10-20T22:58:00Z","url":"https://api.github.com/repos/jashkenas/coffee-script/issues/1783","id":2010519,"assignee":null,"milestone":null,"closed_at":"2011-10-20T22:58:00Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/47aeb7b493959f3a963e46b6e7bd807d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"47aeb7b493959f3a963e46b6e7bd807d","url":"https://api.github.com/users/Izikiel","id":1139783,"login":"Izikiel"},"html_url":"https://github.com/jashkenas/coffee-script/issues/1783","labels":[],"state":"closed"},"legacy":{"number":1783,"action":"closed","issue":2010519}}