Using map instead of iteration

Russel Winder russel at russel.org.uk
Mon Mar 7 02:27:29 PST 2011


On Sun, 2011-03-06 at 17:41 -0800, Jonathan M Davis wrote:
[ . . . ]
> If anything, I'd argue to simply remove .. from foreach and have iota be the way 
> to do it. The only other inconsistency is with case statements, but making them 
> have an open right end would likely be problematic (not to mention break tons of 
> code), whereas an open right end is exactly what it should be in the general 
> case. I really don't see the problem other than the fact that using .. in 
> foreach is completely redundant at this point, since we have iota.

If .. is not going to mean a range of values everywhere then it should
be allowed nowhere.  This includes array slicing as well as foreach.
Having a special case that leads people to try and use it as the general
case is the worst of all worlds.

Case labels will be the problem.

range in Python is a range that is inclusive at the beginning and
exclusive at the end, there are no special cases.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110307/7b521bfd/attachment.pgp>


More information about the Digitalmars-d mailing list