From: Hugh Sasse Staff Elec Eng Date: 2004-11-23T07:59:49+09:00 Subject: Re: Blocks, serailizing, and "configure, don't integrate" On Tue, 23 Nov 2004, Phil Tomson wrote: > In article , > Hugh Sasse Staff Elec Eng wrote: >> The second part of this is: >> >> I find myself wanting blocks to be real objects before they become > > Have you looked at nodewrap? > http://rubystuff.org/nodewrap/ No, I'll take a look. Thank you. > > I also sometimes think that it would be useful to have a Block class and > that code blocks would be instances of Block... but I suspect that would > be too big of a change to Ruby at this point. Oh, certainly too big for 1.x but maybe 2 could have it if it is worthwhile... > > Anyway, if there were a Block class it might work something like: > [example elided] That was how I was thinking. > > But then, maybe there wouldn't be enough difference between a Block and a > Proc to make this kind of change worthwhile. Also, while in this simple well, a Block would be the syntactic structure, the proc would be it brought to life... > case you could easily marshal 'block', other cases where a block needed to > carry around more context (references to in-scope variables, etc. ) would > still seem to be problematic unless you were to say that Block objects do > not carry around any context, but that they 'inherit' the context in which > they are loaded (the problem then being that if the Block refers to some Yes, I was thinking the latter. > variables that it expects to have in scope but aren't in the scope where > the marshalled Block is loaded). That can apply to any loaded object really, it may possibly contain information irrelavent to its context, but that person doing the loading should know what context to load it into. > > Phil > Thank you, Hugh