3 ms·
No discussion of meta-programming? Can you duplicate the Ruby tricks in JavaScript?
by omouse 18y ago
No discussion of meta-programming? Can you duplicate the Ruby tricks in JavaScript?
- jrockway 18y agothe Ruby tricks? Why couldn't you? You have anonymous functions in JavaScript, that's as much metaprogramming capability as you get in Ruby. (Notably absent from both are macros.)
- raganwald 18y agoWell, you are obviously right about JS having anonymous functions. In addition to anonymous functions, Ruby also has a very late-binding object and class system borrowed from SmallTalk that also--to the Java or C# programmer--looks like trickery. This can be built on top of JS, of course, but I also recall Object Assembler ;-)
- tlrobinson 18y agoJavaScript doesn't have "method_missing" (but Objective-J does! It's called "forwardInvocation")