Questions tagged [first-class]

An entity in a programming language is called first-class if it can be constructed and manipulated at runtime.

36 questions
0
votes
1 answer

OCAML first class modules signature inference

1) Suppose there is a module module Int_Sig_1 = struct let x = 1 end ;; 2) and an explicit signature of this module module type INT_SIG = sig val x:int end ;; 3) and i create a first-class module based on the above module and module type let…
0
votes
5 answers

Unexpected behavior of alert function in javascript

I was experimenting on alert but alert dosen't worked as i expected have look below lines: var tobealerted = function(){return 'worked!'}; now when i alert this: alert(tobealerted()); this will work fine! now alert(tobealerted); in this i…
anni
  • 290
  • 1
  • 3
  • 15
0
votes
1 answer

js: return both a first-class object and a string from a variable

I've built a plugin that will use modules. Basically functions that can be added to the code in order to provide additional functionality. In the plugin is a function to call these modules. Previously, I had called them like…
Adam Cook
  • 622
  • 2
  • 6
  • 21
0
votes
3 answers

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…
Tordek
  • 10,628
  • 3
  • 36
  • 67
0
votes
1 answer

First Class Objects in java

Possible Duplicate: What are first-class objects in Java and C#? Now I heard that First class objects in java are objects created without using the new keyword like String Now we declare Arrays also without without new keyword ? so are they first…
Girish Nair
  • 5,148
  • 5
  • 40
  • 61
-1
votes
2 answers

how to make a first-class object in javascript

After reading about the first class object i decided to make my new first-class object like a function but with another name. i searched and found many thing about functions in javascript. conclusions from my research 1) that every function is an…
anni
  • 290
  • 1
  • 3
  • 15
1 2
3