Fabulous Adventures In Coding : ScriptingScripting languagesGuru meditations on scope chains of closures- September 30, 2005 I just had a really interesting meeting with some of the scripting community MVPs. I may write up some notes on that meeting here next week, so watch this space. In other news, someone asked me last night (and I quote) Oh ECMA guru, can you provide a succinct explanation of why the following code works, but if I replace x with this it fails Number.prototype.times = function(f) for(var i = 0; i < this; i++) f(); Number.prototype.raiseTo = function(n).http://blogs.msdn.com/ericlippert/archive/2005/09/30/475826.aspx Implementing Event Handling, Part Two- September 21, 2005 It's been an insanely busy month for me, between having multiple out-of-town guests, throwing a party for the people who couldn't make it to the wedding, and oh yeah, getting up to speed on the C compiler and trying to understand the implications that LINQ features are going to have on the current implementation. Not much time for blogging. Hopefully October will be a little bit more under control. Anyway, I was talking about early-bound event binding. Basically the idea is that the..http://blogs.msdn.com/ericlippert/archive/2005/09/21/472465.aspx Implementing Event Handling, Part One- September 9, 2005 Back in February I posted a bit about how script hosts such as Windows Script Host dynamically hook up event sources (objects) to event sinks (chunks of script that run when the event fires.) It has become apparent from some questions I've received recently that it would be helpful to have a more detailed explanation of how event handling works in COM, and how that applies to late-bound scripting languages. We'll start in the early-bound world and then move into the scripting world next...http://blogs.msdn.com/ericlippert/archive/2005/09/09/463215.aspx 250% of what, exactly- September 1, 2005 I just got a question this morning about how to take two collections of items and determine how many of those items had the same name. The user had written this straightforward but extremely slow VBScript algorithm: For Each Frog In Frogs For Each Toad In Toads If Frog.Name = Toad.Name Then SameName = SameName + 1 Exit For End If NextNext There were about 5000 frogs, 3000 toads and...http://blogs.msdn.com/ericlippert/archive/2005/09/01/459166.aspx |