to className tempVar : instVar : classVar ( isnew?("tempVar _ 1. "instVar _ 2. "classVar _ 3) %tempVar?(%_?(:tempVar) !tempVar) 'not work...' %instVar?(%_?(:instVar) !instVar) 'set or return the inst var' %classVar?(%_?(:classVar) !classVar) 'set or return the class var')) "inst1 _ className "inst2 _ className inst1 instVar '=> 2' inst2 instVar '=> 2' inst1 classVar '=> 3' inst2 classVar '=> 3' inst1 instVar _ 20 inst1 instVar '=> 20' inst2 instVar '=> 2' inst1 classVar _ 30 inst1 classVar '=> 30' inst2 classVar '=> 30'
このページを編集 (989 bytes)
以下の 2 ページから参照されています。 |
This page has been visited 3828 times.