discussions on the language: For and Which
- To: mathgroup at smc.vnet.net
- Subject: [mg111561] discussions on the language: For and Which
- From: Li Zhengji <zhengji.li at gmail.com>
- Date: Thu, 5 Aug 2010 07:00:23 -0400 (EDT)
Hi all,
1. Attributes of For are {HoldAll, Protected}.
But I think HoldRest is just OK for For, because the first argument
"start" is evaluated once in every For.
2. Which takes even number of arguments
If we want a "default" branch in Which, we need to set the last 2
argument to "True, XXX".
Obviously, Which can be extended this without any problem: allow odd
number of arguments, and the last argument is treated as the "default"
branch.
--
Best Regards,
Li Zhengji