From: Josh Cheek Date: 2011-06-02T00:38:29+09:00 Subject: Re: CORE - Specialized Attribute Definition --20cf3071d02ed1ac6a04a4a84f58 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 1, 2011 at 4:15 AM, Ilias Lazaridis wrote= : > On 1 =CE=99=CE=BF=CF=8D=CE=BD, 11:28, Josh Cheek w= rote: > > 2011/6/1 Ilias Lazaridis > > > On 31 =C3=8C=C3=9C=C3=BA=C3=AF=C3=B2, 17:26, Josh Cheek wrote: > > > > [Note: parts of this message were removed to make it a legal post.= ] > > > > > > On Tue, May 31, 2011 at 8:05 AM, Ilias Lazaridis < > il...@lazaridis.com > > > >wrote: > > > > > > > ruby 1.9 > > > > > > > (this is about the *abilities* or the ruby 1.9 language) > > > > > > > class Persnon > > > > > attrib name String opt1 opt2 > > > > > attrib age Integer > > > > > end > > > > > > > The main questions: > > > > > a) Can such an "attrib" method be implemented with ruby code? > > > > > b) Can such an "attrib" functionality be implemented on the C-lev= el > > > > > (as extension, not as modification of source)? > > > > > > > Any examples? > > > > > > > Please notice the requirements: > > > > > > > 1) "name" and not ":name" > > > > > 2) no comma between "name" and "String" and "opt1" ... > > > > > > Almost certain this can't be done. > > > > > ok > > > > > > You could do something somewhat close to that, as seen in the below > > > example. > > > [...] > > > > > this is far to complex expressed. > > > > > Can you simplify this, e.g. avoiding usage of "rspec"? > > > > No, because the request itself makes me worried you'd actually use that > > code. > > This is a public archived group, thus other readers will benefit from > a compact answer, too. > > Of course I can try to minimize / summarize the code myself. > > . > > -- > http://lazaridis > > I don't think anyone else has this problem. But if they do, I don't think they'll be able to understand the solution anyway. --20cf3071d02ed1ac6a04a4a84f58--