[Q] Enum style Object?

Niko Schwarz niko.schwarz at gmx.net
Wed Feb 19 09:30:38 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Mittwoch, 19. Februar 2003 08:06 schrieb Hannes Hirzel:

> Perhaps it is easier to explain if you provide some code
> or a specific example.

I understand him like this, at least I myself do it with symbols.
Here's a snippet out of my jabber code:

el name caseOf: {
		[#stream:stream] -> [self verifyProtocol: el attributes].
		[#iq] -> [self channel: #iq add: el].
		[#message] -> [self
			channel: #message
			add: (el asJabberElementForConn: self)].
		[#presence] -> [self
			channel: #presence
			add: (el asJabberElementForConn: self)].
		[#stream:error] -> [self channel: #stream:error add: el]}
		 otherwise: [self error: el name asString , ' is unknown!']

Where el is kind of a "state variable". If you feel this is too undocumented, 
and so did I, you can add a comment to the message explaining the possible 
values of el. If it is an instance variable, it belongs into the Structure: 
part of your class comment.

regards,

nick
- -- 
You are only young once, but you can stay immature indefinitely.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+U07B3P3nmXTVnC8RAuPXAJ0Vsq7e4QzCOrlCjAI+5794ZHgFawCgyolX
ZrQk/5Xd48L3mueR4Torz9A=
=iCkh
-----END PGP SIGNATURE-----



More information about the Squeak-dev mailing list