From: MikkelFJ Date: 2001-08-04T21:11:22+09:00 Subject: [ruby-talk:19126] Re: Something nicer than @? "David Alan Black" wrote in message news:NxQa7.10447$5j7.519803@e420r-atl1.usenetserver.com... > I don't know, but I suspect it would be literally impossible to parse. Yes, postfix ' doesn't work (as in x') because functions do not require neither parenthesis nor space before first parameter. The dot prefix (as in .x) is also not very good for the following reasons: You could get into strange cases where function could return an object to which .x is applied instead of taking it as argument: foo .x => foo().x vs. foo(.x) but since arguments are fixed length it might work. But it would make the program hard to read. If Ruby were to support optional parameters, or polymorphic methods with different number of args, it definitely wouldn't work. Not unless you required parenthesis in case of a conflict. Then there is : prefix. It kind of naturally extends the attr : x syntax. class Scalar attr : value def initialize value :value = value end end BTW: my primary interest in the @@ syntax was not to make class member access easier - but if you start fiddling with @, you'd naturally have to think about @@ as well for consistency reasons. However, the notion of using . is not a good for mixins and general moving code around (the very bad copy-paste we all do). The explicit name reference is a very annoying feature in for example C++ constructors, which is avoided in Ruby's initialize constructor. That is why I suggested 'class' or 'shared' and not the class name as in Thing.cvar in your example. Mikkel