Re: Switch and List: How to combine?
- To: mathgroup at yoda.physics.unc.edu>
- Subject: Re: Switch and List: How to combine?
- From: HAY at leicester.ac.uk
- Date: Tue, 22 OCT 91 23:30:15 GMT
The following retains the HoldAll attribute of Switch and so does not force
evaluation of all arguments. It may be quicker for some applications.
SetAttributes[SwitchList, HoldAll]
SwitchList[expr_, {x___}] := Switch[expr,x]
From
Allan Hayes
Department of Mathematics
The University
Leicester LE1 7RH
U.K.
hay at leicester.ac.uk