On Mon, 17 Jul 2006 transfire / gmail.com wrote:

> I imagine that still can be worked in to your impl, but it does starts
> to get a little thicker.


yes, a bit.  very doable though...

> I should also note that it's not just annotations, I use it lots else where
> too. I esspecially like using Facets' OpenCascade on YAML load configs.
>
>  s = %{
>    a:
>      b:
>        c: "abc"
>  }
>
>  data = OpenCascade[ YAML.load(s) ]
>
>  data.x.y.z  #=> "abc"
>
> (OT. Notice BTW how I use ::[] on OpenCascade. It's a subclass of Hash.
> In an earlier post I mentioned how I felt that ::new should be able to
> take a hash rather than a default value --well there's why. I actually
> just spent ~2 hours tracknig a bug that came down to using ::new when I
> should have used []. That sucked!)

yikes.  i've done exactly this kind of this many times but i'm tending away
from it.  the reason is that the spec just doesn't quite fit when s is defined
thusly:

   s = <<-yml

     "hard to use" : "forty-two"

     42 : "impossible to use"

     "!can't work" : "etc"

   yml

i suppose it's ok to contrain configs you have keys that are valid ruby
methods, still i've just found myself in a corner with that a few times and
have strayed away from it every since.  like i said, i still have lots of code
doing stuff with method_missing, but i thought i'd put my thought out there
for posterity and for people starting new designs.

> You're right about that. There are limitations to using method_missing.
> Though I don't mind so much if the limitations are *well defined* and
> minimial, but the current state of affairs is too iffy.

what do you mean 'iffy' exactly?  that the list of 'require' methods seems to
change every few months?

regards.


-a
-- 
suffering increases your inner strength.  also, the wishing for suffering
makes the suffering disappear.
- h.h. the 14th dali lama