Switsch Statement like in java.
Michaël Piel
piel at ensm-douai.fr
Fri Sep 16 08:54:21 UTC 2005
Instead of #caseOf: and #caseOf:otherwise: use a dictionary.
michael
On Wed, 7 Sep 2005 10:52:06 -0300
"Ivan Tomek" <ivan.tomek at acadiau.ca> wrote:
> Thanks.
>
> Ivan
>
> > -----Original Message-----
> > From: matejkob at stonline.sk [mailto:matejkob at stonline.sk] On
> > Behalf Of Matej Košík
> > Sent: Wednesday, September 07, 2005 9:42 AM
> > To: The general-purpose Squeak developers list
> > Subject: Re: Switsch Statement like in java.
> >
> > Ivan Tomek wrote:
> > > Hi Matej,
> > >
> > > I use VW rather than Squeak. Is the code available in a
> > text file or some other universally downloadable form?
> > >
> > > Thanks.
> >
> > Hi Ivan,
> >
> > I have filed relevant sources out for you, they can be now
> > downloaded here
> >
> > http://altair.dcs.elf.stuba.sk/~kosik/tmp/COND/
> >
> > There are three files
> >
> > Association-*cond.st
> > AssociationTest-testCond.st
> > Association class-*cond.st
> >
> > The file `AssociationTest-testCond.st' contains black-box
> > checking whether the provided functionality works as expected.
> >
> > File `Association-*cond.st' contains a single method
> > doesNotUnderstand: aMessage
> > It either invokes generation of the not-yet-generated
> > cond:cond:cond:...
> > method or reraises the exception (in the rest cases).
> >
> > File `Association class-*cond.st' contains two methods
> > generateCondMethodFor: numberOfBranches
> > removeGeneratedCondMethods
> > The first one generates cond:cond:cond:... method with a
> > given number of branches. The second one removes all the
> > hitherto generated method. It is supposed to provide
> > convenient ways how to clean things.
> >
> > I think that I should also enrich the documentation with
> > anti-examples---i.e. incorrect usages.
> >
> > If you find any natural example where cond:cond:cond:...
> > where it would be advantageous to use it, I would be grateful
> > if you let me know. Until know I have none.
> >
> > Regards
> > --
> > Matej Košík
> > ICQ: 300133844
> > http://altair.dcs.elf.stuba.sk/wiki/Kosik/Main
> >
>
More information about the Squeak-dev
mailing list
|