Scopes

Scopes - Names Scopes Bindings Textbook Chapter 3 1 Binding...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 4101: Programming Languages 1 1 Names, Scopes, Bindings Textbook Chapter 3 Binding Association of name with value language design time operators language implementation time size of int in C++ program writing time compile time + link time load time run time virtual functions Static vs. dynamic 2 Object Lifetimes Creating of object Creation of binding Use of binding Deactivation/reactivation of binding Destruction of binding Destruction of object 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CSC 4101: Programming Languages 2 Storage Allocation Static allocated at link time static fields Stack allocated in function call local vars Heap allocated dynamically using new 4 Static vs. Dynamic Scope (define x 1) (define (bar) x) (define (foo f) (define x 2) (f)) (foo bar) Static scoping: x = 1 Dynamic scoping: x = 2 5 Implementation of Static Scoping Use Closures as function values Pointer to code Pointer to environment Remember environment in which function is defined 6
Background image of page 2
CSC 4101: Programming Languages
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/31/2011 for the course CSC 4101 taught by Professor Kraft,d during the Fall '08 term at LSU.

Page1 / 4

Scopes - Names Scopes Bindings Textbook Chapter 3 1 Binding...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online