vieweditattachhistoryswikistopchangessearchhelp

Smalltalk-72

入手先


関連




サンプルコード

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'



Uploaded Image: Smalltalk-72.gif

このページを編集 (989 bytes)


Congratulations! 以下の 2 ページから参照されています。

This page has been visited 3812 times.