The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
314 views
Various parameter passing mechanisms have been in used in different programming languages. Which of the following statements is true?
(a) Call by value result is used in language Ada
(b) Call by value result is the same as call by name.
(c) Call by value is the most robust.
(d) Call by reference is the same as call by name.
(e) Call by name is the most efficient.
asked in Programming by Boss (7k points) | 314 views

1 Answer

+1 vote
Best answer
(a) is true. Ada supports in-out parameter passing, which is nothing other than call by value result (but Ada in GATE syllabus?)
(b) Not true.
(c) Most robust? I don't know what is meant by robust here.
(d) Not true.
(e) Not true. Because in call by name, the parameter is re-evaluated at every occurrence of the formal paramater and hence efficiency will only be less.

Reference:
http://courses.cs.washington.edu/courses/cse341/03wi/imperative/parameters.html
answered by Veteran (14.6k points)
selected by
I think by robust they mean not having problems that call by name(with arrays) and call by value results(same parameters passing twice) have...thanks
okay. So how do you compare call by value and call by reference in terms of robustness?
I knew I embroiled myself on the wrong course...I take back my words :(
Humm.. If call by value is robust, then call by value result must also be robust.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,545 questions
39,231 answers
109,314 comments
36,613 users