Switch and List
- To: mathgroup at yoda.physics.unc.edu
- Subject: Switch and List
- From: gaylord at ux1.cso.uiuc.edu
- Date: Tue, 28 Jan 1992 01:27:08 -0600
Switch[expr, {form1, val1, form2, val2, form3, val3}]/.List->Sequence Switch::argct: Switch called with 2 arguments. Switch[expr, form1, val1, form2, val2, form3, val3] Switch[expr, {form1, val1, form2, val2, form3, val3}]/.{x__}->x Switch::argct: Switch called with 2 arguments. Switch[expr, form1, val1, form2, val2, form3, val3] Apply[Sequence, Switch[expr, {form1, val1, form2, val2, form3, val3}], 1] Switch::argct: Switch called with 2 arguments. Switch[expr, form1, val1, form2, val2, form3, val3] note: you can direct M not to give you the message. Off[Switch::argct] Switch[expr, {form1, val1, form2, val2, form3, val3}]/.List->Sequence Switch[expr, form1, val1, form2, val2, form3, val3] etc. gaylord at ux1.cso.uiuc.edu