Feedback order of building lamda and subbing reals for fmls 

Forum: Com Sci 221, U Chicago, Autumn 2001, Old Classwork
Re: News Assignment #7 due Monday, 19 November (Mike O'Donnell)
Re: Question dynamic scope? and tree representation? (Terry (Sotiria) Lampoudi)
Re: Idea dynamic vs. static (Roni Choudhury)
Date: 2001, Nov 18
From: Terry (Sotiria) Lampoudi <slampoud@cs.uchicago.edu>

so what it seems to boil down to is the order of these 2 operations:
  1. buiding the lambda function
  2. substituting the real argument in place of the fml argument
If you do 1, then 2, you've built the outermost lambda without ever doing z gets 'y, then z gets 'y during 2 and the fact that z got something else inside the lambda is forgotten

If you do 2, then 1, you substitute all occurences of z with 'y first, then build the lambda, evaluating as you go... So then if you tried to print z afterwards it would evaluate to 'x because that's the last thing it got.

So I think the first is dynamic scoping and the second is lexical.
Make sense?
--TL


Messages

1. Idea My Evaluator by Mamun Tanveer, 2001, Nov 18
2. Feedback It's the order of substitution vs. application of the function by Mike O'Donnell, 2001, Nov 19

to: "order of building lamda and subbing reals for fmls"