Search   Feed   Browse   Add
Feed items 1 - 6 of 6 for August 2005

VBScript Default Property Semantics - August 30, 2005

Heres a question I recently got about VBScript, where by "recently" I mean August 28th, 2003. This code works just fine: Set myObject = CreateObject("myObject")myObject.myName = "Eric" WScript.Echo myObject ' myName is the default property, so prints "Eric" But myObject = "Robert" doesn't set the default property, it sets the variable to the string. Why does reading work but writing fail This works in VB6, why not VBScript  In a strongly typed language such as VB6 the compiler can...
http://blogs.msdn.com/ericlippert/archive/2005/08/30/458051.aspx

Recursion, Part Six: Making CPS Work - August 15, 2005

JScript doesn't support CPS natively but we can write another dispatch engine that makes it work. There's only ever one active continuation, so lets have a new rule:  JScript CPS functions are allowed to return, but the last thing that they do must be to tell our dispatch engine what the continuation was. To keep things simple, we'll also say that every CPS-style function takes exactly one argument. Of course, that can be an object that contains multiple fields should the function...
http://blogs.msdn.com/ericlippert/archive/2005/08/15/recursion-part-six-making-cps-work.as...

Recursion, Part Five: More on CPS - August 11, 2005

Suppose we wanted to write this by-now-familiar little function in continuation passing style: function treeDepth(curtree)  if (curtree == null)    return 0;  else      var leftDepth = treeDepth(curtree.left);    var rightDepth = treeDepth(curtree.right);    return 1 + Math.max(leftDepth, rightDepth);  Let's start by getting rid of the returns, since there are no returns in CPS. Rather, we "return" by passing the...
http://blogs.msdn.com/ericlippert/archive/2005/08/11/recursion-part-five-more-on-cps.aspx

Recursion, Part Four: Continuation Passing Style - August 8, 2005

We're getting hung up on the stack management aspects of recursive programming. Why do we need a stack at all What purpose does it serve If you're like most developers, you probably learned about subroutines and functions at an early age. The idea is pretty straightforward.  You stop what you're doing right now, go perform some other task, and then pick up where you left off, possibly using data computed by the other task.  But this idea of "pick up where you left off" means that you..
http://blogs.msdn.com/ericlippert/archive/2005/08/08/recursion-part-four-continuation-pass...

Recursion, Part Three: Building a Dispatch Engine - August 4, 2005

There's a particular technique that I like to use to solve problems -- it doesn't always work, but when it does, it can produce programs of surprising elegance and power. The technique is this: if you have a specific problem to solve, solve a more general problem, and then your problem is just a special case. It's like that joke someone mentioned during my series on high-dimensional arithmetic -- it's easy to imagine a 9-dimensional space, just imagine an n-dimensional space and set n=9. That...
http://blogs.msdn.com/ericlippert/archive/2005/08/04/recursion-part-three-building-a-dispa...

Recursion, Part Two: Unrolling a Recursive Function With an Explicit Stack - August 1, 2005

That recursive solution is pretty cool, to be sure. But there is one big problem with it.  Consider this Jscript program that puts a few more nodes into our tree from last time: function tree(value, left, right)  this.value = value;  this.left = left;  this.right = right;for (var i = 1 ; i < 1500 ; ++i)  mytree = new tree(i, mytree, null)print(treeDepth(mytree)); This is not a very well-behaved binary tree its actually mostly a linked...
http://blogs.msdn.com/ericlippert/archive/2005/08/01/recursion-part-two-unrolling-a-recurs...
Available Archives
- July (1 item)
- August (6 items)
- September (4 items)
- October (3 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact