"Jonathan Sillito" <[EMAIL PROTECTED]> writes: >> -----Original Message----- >> From: Sean O'Rourke [mailto:[EMAIL PROTECTED]] >> >> I think I didn't look through the patch queue carefully enough ;). I >> gather that it's accepted practice (or something like that) to use an >> array of pointers instead of links to avoid having to do a traversal when >> accessing outer scopes, so that's why I did things this way. Out of >> curiosity, how were you planning to handle e.g. recursive functions? > > Umm, I am not sure ... > >> Unless I'm misreading your patch, it always sets the parent static scope >> to the parent dynamic scope, which often isn't what one wants. > > I see. So just to see if I understand things correctly, consider an example > in some made up language: > > function get_counter(increment) { > var last = 0 > > function counter() { > last = last + increment > println last > } > > return counter > }
[...] > get_counter: > new_pad 1 Doesn't this violate the 'caller saves' principle, making it hard to do tail call optimization? Would it make sense to move the creation of a new pad into the Sub's invoke method? [...] -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?