Top "Enumeration" questions

The process of enumerating values, for example from some collection.

How to enumerate an enum

How can you enumerate an enum in C#? E.g. the following code does not compile: public enum Suit { Spades, …

c# .net loops enums enumeration
C# loop - break vs. continue

In a C# (feel free to answer for other languages) loop, what's the difference between break and continue as a …

c# loops enumeration
PHP and Enumerations

I know that PHP doesn't have native Enumerations. But I have become accustomed to them from the Java world. I …

php enumeration
How to iterate a loop with index and element in Swift

Is there a function that I can use to iterate over an array and have both index and element, like …

arrays swift enumeration
How do I iterate over an NSArray?

I'm looking for the standard idiom to iterate over an NSArray. My code needs to be suitable for OS X 10.4+.

objective-c cocoa iteration nsarray enumeration
What does the "map" method do in Ruby?

I'm new to programming. Can someone explain what .map would do in: params = (0...param_count).map

ruby map range enumeration
for each loop in Objective-C for accessing NSMutable dictionary

I am finding some difficulty in accessing mutable dictionary keys and values in Objective-C. Suppose I have this: NSMutableDictionary *xyz=[[…

objective-c nsdictionary enumeration nsmutabledictionary key-value
foreach vs someList.ForEach(){}

There are apparently many ways to iterate over a collection. Curious if there are any differences, or why you'd use …

c# .net generics loops enumeration
Collection was modified; enumeration operation may not execute in ArrayList

I'm trying to remove an item from an ArrayList and I get this Exception: Collection was modified; enumeration operation may …

c# exception collections enumeration
Java Enum Methods - return opposite direction enum

I would like to declare an enum Direction, that has a method that returns the opposite direction (the following is …

java enums enumeration