From: "trans. (T. Onoma)" Date: 2004-10-29T05:09:25+09:00 Subject: Re: Ruby Vs. ... might find comparison of interest. On Thursday 28 October 2004 03:49 pm, James Britt wrote: | > So its easy to say he doesn't know diddly. But we as a community still | > need to address such things --and from both sides. Where they are | > accurate we should improve on our end, and where they are inaccurate we | > need to get them to improve on their end. On that not I will email him. | > Is ther anything else I should add besides the instance var thing? | | I already sent him a note. We had short exchange and he is going to | update his Ruby-DyBase API. You da Man! | > Speaking of which what advantage does | > | > obj.instance_var_set("@x", 10) | > obj.instance_variable_get("@x") | > | > have over, | > | > obj.@x = 10 | > obj.@x | > | > Surely the later can be parsed. | | Perhaps. I'm at odds over the ability to simply trod over the | object->message-to-access-an-attribute approach, where one must | explicitly expose object attributes via messages if other code is to | access them. | | It can be easy to abuse, but then, so what? | | The uglier syntax may at least serve as a red flag that you are doing | something of dubious OO purity. If it matters. I pretty much lean toward the "so what" here. It's a bit silly to, on the one hand, support a feature and yet, on the other, make it syntatically awkward b/c it goes against some "formal OOP grain" --a valid concern, but these are indispensable for meta-coding. So, I think the more appropriate way to handle it is by having to require the ability first. require 'iv_accessors' my 2%, T.