From Second Life Wiki
integer llForeach(array name); instructions; llEndForeach;
walks through the Array name Returns 0 if array name does not exist and 1 otherwise.
Reasons against this proposal in its current incarnation
- This proposed syntax does not fit with the style of LSL. The C# syntax for foreach would be more in place with LSL.
- The function return is nonsensical, the code shouldn't compile if the array doesn't exist. LSL is strong typed.
- Because of LSL's strongly typed bytecode, support for heterogeneous lists or arrays would be if not impossible, cumbersome.
- New bytecodes would have to be implemented for this feature not to very bytecode intensive.