first-class

Returning a function in C#

I have this snippet private void westButton_click(object sender, EventArgs ea) { PlayerCharacter.Go(Direction.West); } repeated for North, South and East. How can I declare a function that'd let me generate methods like ir programmatically? e.g., I'd like to be able to call northButton.Click += GoMethod(Direction.North); inst...

Are primitives different in java and c#?

I am manually converting code from Java to C# and struggling with (what I call) primitive types (see, e.g. http://stackoverflow.com/questions/1597154/do-autoboxing-and-unboxing-behave-differently-in-java-and-c). From the answers I understand that double (C#) and Double (C#) are equivalent. double (C#) can also be used in containers, e.g...

What are first-class objects in Java and C#?

When I started OO programming many years ago I gained the impression that variables (if that is the right word) were either "primitives" (int, double, etc.) or first-class objects (String, JPane, etc.). This is reinforced by a recent answer on primitives in Java and C# (@Daniel Pryden: http://stackoverflow.com/questions/1597999/are-primi...

Can First-class functions in Scala be a concern for allocating a large PermGen Space in JVM?

Regarding first-class functions in Scala, it is written in the book Programming by Scala: A function literal is compiled into a class that when instantiated at run-time is a function value. When there will be many first-class functions used in a program, will this affect the JVM's PermGen space? because instead of simple functi...