Question

In Fortran 77, local variables were typically allocated statically. In Algol and its descendants (e.g., Ada...

In Fortran 77, local variables were typically allocated statically. In Algol and its descendants (e.g., Ada and C), they are typically allocated in the stack. In Lisp they are typically allocated at least partially in the heap. What accounts for these differences? Give an example of a program in Ada or C that would not work correctly if local variables were allocated statically. Give an example of a program in Scheme or Common Lisp that would not work correctly if local variables were allocated on the stack.

Homework Answers

Answer #1

In Fortran 77, local variables are typically allocated statically.In Algol and its descendants (e.g., Pascal and Ada), they are typically allocated in the stack.In Lisp they are typically allocated at least partially in the heap.Give an example of a program in Pascal or Ada that would not work correctly if local variables were allocated statically.Give an example of a program in Scheme or Common Lisp that would not work correctly if local variables were allocated on the stack.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Consider insertsort. Suppose that the input array A has 1% probability to be monotonically decreasing. Show...
    asked 3 minutes ago
  • Your company is thinking of introducing a Bring Your Own Device (BYOD) policy. You have been...
    asked 10 minutes ago
  • Attached is the file GeometricObject.java. Include this in your project, but do not change. Create a...
    asked 12 minutes ago
  • Suppose the number of cars in a household has a binomial distribution with parameters n =...
    asked 15 minutes ago
  • HR needs some information on the new interns put into a database. Given an id, email,...
    asked 36 minutes ago
  • Problem solving strategies Questions years = input("Enter a number of years and I'll tell you how...
    asked 40 minutes ago
  • Calculate ?Hrxn for the following reaction: CH4(g)+4Cl2(g)?CCl4(g)+4HCl(g) Use the following reactions and given ?H?s. C(s)+2H2(g)?CH4(g)?H=?74.6kJC(s)+2Cl2(g)?CCl4(g)?H=?95.7kJH2(g)+Cl2(g)?2HCl(g)?H=?184.6kJ Express...
    asked 47 minutes ago
  • ASCII (American Standard Code for Information Interchange) has an encoding for every character of the alphabet,...
    asked 1 hour ago
  • Is home confinement with electronic monitoring a deterrent? Are there negatives to being confined to one’s...
    asked 1 hour ago
  • Social hostility can have severe lasting effects of interperpersonal relationship during our adolescence years, which if...
    asked 1 hour ago
  • - A series RLC circuit has R=15 ?, L=1.5 H, and C=15 ?F. (a) For what...
    asked 1 hour ago
  • TV Circuit has 30 large-screen televisions in a warehouse in Erie and 60 large-screen televisions in...
    asked 1 hour ago