Everything2
Near Matches
Ignore Exact
Full Text
Everything2

scope

"scope" is also a: user

created by BaronCarlos

(thing) by Tommy (1.2 y) (print)   ?   (I like it!) Wed Dec 13 2000 at 18:43:29

A UK charity for those with cerebral palsy.

Scope aims to provide: (Taken from a statement by Richard Brewster, Chief Executive of Scope)

It does this through a mixture of research, advocacy and direct support in the form of information packs, schools and residential centres.

They also run a helpline that can be contacted in the UK on 0808 800 3333


(idea) by hobyrne (3 y) (print)   ?   (I like it!) Tue Oct 16 2001 at 22:59:07

The scope of an identifier in a program is those parts of the program where the identifier refers to (or, is bound to) some particular thing. There are two primary types of scope in programming languages, lexical scope (a.k.a. static scope) and dynamic scope.

Lexical scope is the name for the situation in which the scope matches some static, identifiable part of the text of the source code. For example, in C, the lexical scope is usually between the '{' symbol just before the declaration if the identifier and the corresponding '}' symbol (except in sub-blocks in which the same identifier is redeclared). One can tell by examining the text whether a particular part of the code is within a particular lexical scope or not. In short, identifiers are linked with what they identify at compile-time. The proces of binding lexical-scope identifiers to objects is called lexical binding.

Dynamic scope is a different beast, old implementations of Lisp implement this dynamic (ariels tells me that newer implementations of Lisp all have lexical binding by default). In this case, identifiers are linked with what they identify at run-time; the scope begins when the identifier is declared and ends usually at the end of the smallest enclosing block. A function (A) in (old) Lisp, for example, may reference an identifier (x) which is not declared in that function. In that case, the value of the identifier is taken from the context from which the function was called - for example, if function B declares x and then calls A, the identifier x within that call to A will reference the x from B. Another function C may also declare a different x, and call A, in which case x within that call to A will reference the x from C. A programmer taking advantage of dynamic scope for some function or procedure should not only document parameters and return values, but also all the other relavent elements of the context from which it is called. The proces of binding dynamic-scope identifiers to objects is called dynamic binding

Dynamic scope can be implemented as a stack of (identifier, value) pairs, such that an entry is pushed onto the stack whenever an identifier is declared, popped off when the identifier reaches the end of it's scope, and whenever an identifier is referenced the stack is searched from the top down to find it's value.

An example will help make the concept clear; consider the following pseudo-code:


 1 : define A
 2 : {
 3 :   declare x as integer
 4 :   define A.A
 5 :   {
 6 :     ...
 7 :     output x
 8 :     ...
 9 :   }
10 :   define A.B
11 :   {
12 :     declare x as string
13 :     ...
14 :   }
15 :   ...
16 :   call A.A
17 :   call A.B
18 :   ...
19 : }
20 : define B
21 : {
22 :   declare x as real
23 :   ...
24 :   call A.A
25 :   ...
26 : }

The lexical scope of the x declared in line 3 is lines 3 to 18, excluding lines 12 to 13. The lexical scope of the x declared in line 12 is lines 12 to 13. The lexical scope of the x declared in line 22 is lines 22 to 25. If there were no 'call's, the dynamic scopes would be effectively the same. Lines 7, 16, and 24 illustrate the difference between the two types of scope. For lexical scoping, at compile-time, the x referenced in line 7 is associated with the static context of x declared in line 3 - therefore, line 7 will always output an integer. For dynamic scoping, at run-time, when executing line 16, the run-time context associates x with an integer, so line 7 will output an integer; but, when executing line 24, the run-time context associates x with a real, so line 7 will output a real. Therefore, with dynamic scoping, line 7 will not always output an integer - in fact, if it weren't for line 16, it may never output an integer.


(definition) by Webster 1913 (print) Wed Dec 22 1999 at 2:54:41

Scope (?), n. [It. scopo, L. scopos a mark, aim, Gr. skopo`s, a watcher, mark, aim; akin to , to view, and perch. to E. spy. Cf. Skeptic, Bishop.]

1.

That at which one aims; the thing or end to which the mind directs its view; that which is purposed to be reached or accomplished; hence, ultimate design, aim, or purpose; intention; drift; object.

"Shooting wide, do miss the marked scope."

Spenser.

Your scope is as mine own, So to enforce or quality the laws As to your soul seems good. Shak.

The scope of all their pleading against man's authority, is to overthrow such laws and constitutions in the church. Hooker.

2.

Room or opportunity for free outlook or aim; space for action; amplitude of opportunity; free course or vent; liberty; range of view; intent, or action.

Give him line and scope. Shak.

In the fate and fortunes of the human race, scope is given to the operation of laws which man must always fail to discern the reasons of. I. Taylor.

Excuse me if I have given too much scope to the reflections which have arisen in my mind. Burke.

An intellectual cultivation of no moderate depth or scope. Hawthorne.

3.

Extended area.

[Obs.] "The scopes of land granted to the first adventurers."

Sir J. Davies.

4.

Length; extent; sweep; as, scope of cable.

scope out the area as a camping site. -->

 

© Webster 1913.


printable version
chaos

Norwegian Pronunciation Guide mouthwash First Things First Manifesto 2000 gnomon
lexical scope DHCP Relay Agent oscilloscope Watchdog timer
Beautiful People Life as a projectionist Structure and Interpretation of Computer Programs aeroponics
The Life and Times, part one. Double mint chocolate chunk cookies propositional calculus match grade
LISP Things that mix well with Vodka Sonnet LXI inner class
oscillating acute Direct Care work
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Look at this mess the Death Borg made!
The bride of Vankenstrein - the continued tedium
We Cannot Breathe, We Cannot Breathe
Toaster
negative nodevertising
Dave's Insanity Sauce
The Library of Babel
Take the skinheads drinking
Danzayémon, Chief of the Etas
Kill your sampler
leaving out parts of the truth. you have to.
Cowboy Bebop
Utah liquor laws
Datagate
New Writeups
XWiz
Trism(review)
artman2003
Briefcase Full of Souls - Part I(fiction)
Dreamvirus
Alan Ladd(person)
waverider37
Harold Holt(person)
The Debutante
Until death do us part(fiction)
Ysardo
a brother to a sister(personal)
antigravpussy
your warm whispers(personal)
Clarke
Multiculturalism(idea)
aneurin
Earl of Landaff(person)
Heitah
Pseudocide(idea)
XWiz
Google Knol(lede)
Mythi
July 24, 2008(personal)
locke baron
The fall of Earth(fiction)
BookReader
Fear the Cold(dream)
Pavlovna
Kathleen MacInnes(person)
Everything 2 is brought to you by the letter C and The Everything Development Company