The Gateway to Computer Science Excellence
+1 vote
554 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.
in Programming by | 554 views

1 Answer

+2 votes
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
by
selected by
0
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
0
okay. So how do you compare call by value and call by reference in terms of robustness?
0
I knew I embroiled myself on the wrong course...I take back my words :(
0
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
52,345 questions
60,471 answers
201,800 comments
95,278 users