From: Robert Klemme Date: 2012-04-06T00:01:57+09:00 Subject: Re: Call for comments - Structure On Thu, Apr 5, 2012 at 4:33 PM, Bartosz Dziewoński wrote: > W dniu 5 kwietnia 2012 14:21 użytkownik Robert Klemme > napisał: >>> Unlike Struct, it creates a "real" class, and it has real instance >>> variables >>> with predictable names. >> >> Why are Struct generated classes not real?  Or does this only refer to >> the fact that #instance_variables returns an empty list?  If so why does >> it matter? > > No. What do you mean by that? > Struct just does not have instance variables, which is surprising, I know - that's the whole point why "#instance_variables returns an empty list". But the question was, whether this is the reason Hal calls them "unreal" - and whether it matters. Both can probably only be answered by him since he coined the phrase... > if you assume that "Point = Struct :x, :y" is a shorthand for "class > Point; attr_accessor :x, :y; def initialize x, y; @x, @y = x, y; end; > end". Well, obviously it is not a shorthand for the code you show. :-) Still it doesn't explain why Hal calls them "unreal". We are still only guessing as to what intentions his might have been. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/