COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In functional programming first-class objects may (select two)
A
be assigned to a variable or used as an argument
B
appear in expressions or returned in a function call
C
not appear in expressions or be returned in a function call
D
be assigned to a variable, but not used as an argument
Explanation: 

Detailed explanation-1: -A first-class object is an entity within a programming language that can: Appear in an expression. Be assigned to a variable. Be used as an argument. Be returned by a function call.

Detailed explanation-2: -First-class functions are functions that can be treated like any other value. You can pass them to functions as arguments, return them from functions, and save them in variables.

Detailed explanation-3: -Functional programming languages, such as Erlang, Scheme, ML, Haskell, F#, and Scala, all have first-class functions.

Detailed explanation-4: -stored in a variable, object, or array. passed as an argument to a function. returned from a function. 26-Jun-2018

There is 1 question to complete.