ln017 - Scope Def: A definition is anything that...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Scope Def: A definition is anything that establishes a possible binding to a name. Def: Scope is a programming language tool to limit the visibility of definitions. Example: Early dialects of Basic did not have scoping rules , all definitions of all variables were visible in the global scope . $A = This is a global string ... Function Foo () $A = This is a local string ... End ... $B = $A What is the content of $B? Problem: When everything is visible everywhere then it is up to the programmer to control visibility of definitions (e.g. globally unique names). Chapter 10 Scoping with Namespaces Def: A namespace is a zone in a programming language which is populated by names. In a namespace, each name must be unique. The most common namespace in programming languages is the block . Scoping with Blocks Def: A block is any language construct that contains definitions and delineates the region of the program where those definitions apply....
View Full Document

This note was uploaded on 10/03/2011 for the course CSC 301 taught by Professor Hamel during the Spring '08 term at Rhode Island.

Page1 / 10

ln017 - Scope Def: A definition is anything that...

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