From: Mathieu Bouchard Date: 2002-01-16T00:57:22+09:00 Subject: Re: Markus' ruby-parser (part 3) On Sun, 13 Jan 2002, Mathieu Bouchard wrote: > This is a follow-up to comment on some of the goofs I made in the version This is another such post to comment on some other goofs, etc. I rethought about the whole thing. It seems that for a while I forgot some important facts about RubySchema. In particular, every evaluable form should have its own class or module, because otherwise some hacks would be required. It also happens that a Var is evaluable. And you see what? I didn't want to turn all Vars into Forms, and Markus did. Well, I repaired my mistake, it's okay now =) The dumps may just look a little more ugly but I think that it's still a good tradeoff. Now. I want to state that I don't see much of a point separating GVars and SVars; I merged them all in GVars; that is, except for __FILE__ and __LINE__, which are, er, exceptions, because they are not variables at all, but are still considered so because I haven't considered anything else yet. "self" has its own class "Self" as you did write; the other pseudo-variables, nil, false, true, are part of LAtom, as was the case from the start, and that's because they really are very much constants. Is there anything I should change here? (remark: GVars can be made pretty special. Ruby has its own mechanism for setting accessors on globals) I'm testing with both 1.6 and 1.7; I just hit a segmentation fault in 1.7. It looks like a NULL pointer in rb_mark_tbl() while marking obj->as.object.iv_tbl in rb_gc_mark_children(), gc.c:780. There were less than 200 stackframes. Revision Path 1.4 lib/metaruby/Contract.rb 1.8 lib/metaruby/Type.rb 1.11 lib/metaruby/RubySchema.rb ________________________________________________________________ Mathieu Bouchard http://hostname.2y.net/~matju