(Note: I'm avoiding the discussion of "switch" in this reply since that suggestion was a thread hijack and completely tangential to the OP-- there are many threads on that suggestion already)

Khaled has never removed an identifier since *parmsN, so your concern is a little overstated. In fact, $* is one of the oldest identifiers mIRC has and is used by countless scripts, so it's not going anywhere.

I think this suggestion in particular is an exercise in form, not function, and misses the point. The classical benefit of a foreach() construct is to allow enumeration via a unified interface for any object/data. Specifically, it allows user-types to be enumerated in the same way builtin-types would be, which is kind of useless in a non-typed language to begin with. Moreover, if you have to pass contextual switches based on the data type, you lose the unified interface and all you're left with is a construct that saves a few keystrokes. Is this really just about vanity?

People need to stop trying to suggest <favourite control flow construct> from <favourite language>, this thread is getting a little ridiculous. Do you really think Khaled is going to add for, foreach at the same time? Maybe if everyone agreed on a single syntax, Khaled might take these suggestions more seriously... but I think this is indicative of the real problem at hand. It shows that this suggestion is nothing more than a stylistic one, which means it's not going to end here. Once Khaled implements for/foreach someone will come along and ask for do/while or "until" loops. How many different syntaxes for looping do you need?

Let's look at this another way: "while" can do everything mentioned in this thread in roughly the same number of bytes. Why don't we have a discussion about what's wrong with while loops first, and then maybe Khaled can understand the real problem at hand, without resorting to feature creep in the parser.

What are the real problems with using "while" that makes "for"/"foreach" superior? Note that "real" should not only include "it takes fewer keystrokes".


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"