[plt-scheme] Define-scope

From: Woodhouse Gregory (gregory.woodhouse at gmail.com)
Date: Wed Aug 20 22:52:06 EDT 2008

On Aug 20, 2008, at 7:08 AM, Pham Dinh Khai wrote:

> Hi there,
> I'm Khai, I am studing DrScheme language. Could you help me to define
>  the meaning of scope in programming
>                 global - variables
>                 local - parameters, local variables and local  
> environments
> I uderstand these aspects but i don't know how to define in words
> hope to hear from you soon
> thanks,
> Khai

Scope is that portion of a program where a binding is in effect. For  

(let ([x 3])
     (let ([x 4])

evaluates to 4 (not 3), because x is evaluated using the binding  
introduced by the innermost let. Notice that the scope corresponds to  
a specific part of the program (source). This is called static  
scoping, and when Scheme was introduced in 1975, one of its main  
innovations was static scoping rules.

"Those who are enamored of practice
without theory are like a pilot who goes
into a ship without rudder or compass."
--Leonardo da Vinci (1452-1519)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080820/f1c6e51b/attachment.html>

Posted on the users mailing list.