Google Answers Logo
View Question
 
Q: language question ( No Answer,   0 Comments )
Question  
Subject: language question
Category: Computers > Programming
Asked by: questionboy-ga
List Price: $20.00
Posted: 24 Nov 2004 00:24 PST
Expires: 29 Nov 2004 22:07 PST
Question ID: 433282
1)In Pure LISP, given that the current values of the variables are as
follows (yes, I know there aren't supposed to be variables in a purely
functional language!):
A: 1
B: A
C: (+ 1 2 3 A B) 
what are the results of evaluating the following expressions: 
A
(QUOTE A)
B
(EVAL B)
(+ 1 (CAR (CDR C)))
C
(EVAL C)
(LET ((B 3)) (EVAL C)) 
Note: One of the expressions produces an error. 

2)Using C precedence rules, draw the abstract syntax tree (also known
as the expression tree for the following two expressions (real
expressions, found in HUGS source code):

(i=(size_t)strlen(t)%BIGEXP)!=0
isAp(x) && followInd(fun(x)) == nameIntToInteger 

You may assume that strlen, isAp, followInd, and fun are all function
names; size_t is a name of a type.

3)What is the value of the variable a after the execution of the
following (pseudo)code, if the language uses pointer semantics for
assignments? What is its value if value semantics is used? Note: In
this language, the lists are mutable objects.

a = (1 2 3 4 5 6); // a list
b = tail(a); // no copying, if pointer semantics
set third element of a to 17
set second element of b to 44

4)The operational semantics of the C for statement by translating it
into equivalent code that uses only conditional and unconditional goto
is to control the flow of execution. Give a similar translation for C
switch statement. Do not forget to explain what happens to break
statements in your translation.

C Statement
for (expr1; expr2; expr3) {
.....
}

Operational Semantics
  expr1;
loop: if expr2 =0 goto out
.....
  expr3;
  goto loop
out:  .....


i need the solution before 11/29
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy