[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [BUG] alias of writer in struct
From:       Joel VanderWerf <vjoel () PATH ! Berkeley ! EDU>
Date:       2005-01-18 1:03:07
Message-ID: 41EC6040.5000001 () path ! berkeley ! edu
[Download RAW message or body]


=== alias-struct.rb ===
S = Struct.new(:a)

class S
   alias a_writer a=
end

s = S.new
s.a_writer 4
p s.a
========================


$ ruby -v alias-struct.rb
ruby 1.8.2 (2004-12-25) [i686-linux]
alias-struct.rb:8:in `a_writer': `a_writer' is not a struct member 
(NameError)
         from alias-struct.rb:8

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic