Understanding Functions and Scopes - Followup Post

There were a couple of questions raised, partially it was due to a slight error that creeped into the code which has been fixed and acknowledged.

This article here tries to answer the same including what is the difference between the β€˜.’ and the β€˜:’ method of calling functions.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15527 reply_id: 315527[/import]

Read some posts on your blog:
http://howto.oz-apps.com/2011/09/wip-eval-routine-for-coronasdk.html

and eval is baaaaaaaddd, verrrryyyy bad function in javascript. Next thing is closures, real and fast closures like this:

[lua]local function Foo(arg)
…
return function() end
end[/lua]

Why you don’t use it in your examples? [import]uid: 12704 topic_id: 15527 reply_id: 57386[/import]

@gtatarkin,

  1. The eval routine which is Work In Progress was for a specific reason/request

  2. there are certain things that can only be resolved with eval

for instance, if I get from a user a string in resulting, that I wasn’t to evaluate, I cannot use inline functions to get the value, or can I?

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15527 reply_id: 57391[/import]

For almost 10 years I work as webdeveloper. Using eval in JS is alway bad thing and there is always way to avoid it. [import]uid: 12704 topic_id: 15527 reply_id: 57404[/import]