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