difference in the following terms with examples. (regarding scope and binding)

M

maadhuu

hello,
i want to know the proper meanings and usage of the following .
a>. dynamic scoping (an online link will be extremely helpful . and what
is lexical scoping or static scoping ??

b>. binding in general and then , dynamic binding and static binding.

Thanking all those who might answer this.....Thanks once more.
 
R

red floyd

maadhuu said:
hello,
i want to know the proper meanings and usage of the following .
a>. dynamic scoping (an online link will be extremely helpful . and what
is lexical scoping or static scoping ??

b>. binding in general and then , dynamic binding and static binding.

Thanking all those who might answer this.....Thanks once more.

Looks like homework. I seem to recall similar questions 20 years ago in
my language syntax classes.
 
M

maadhuu

definitely not Homework......atleast someone tell me what dynamic scoping
is and how it is implemented.
 
A

Alf P. Steinbach

* maadhuu:
definitely not Homework......atleast someone tell me what dynamic scoping
is and how it is implemented.

You don't have that in straight C++.

See <url:
http://en.wikipedia.org/wiki/Scope_(programming)#Static_versus_dynamic_scoping>,
but skimming that explanation I found it hard to follow (even though I know
something about the subject matter), so perhaps pick up a good Lisp or
Scheme book?

Most Lisp books I've seen explain dynamic scoping more clearly than
Wikipedia currently does.

Short of it: when a function refers to an identifier A the reference is
bound to some variable or something depending on where in the call chain an
A was most recently defined, and the call chain is a runtime thing.

Dynamic scoping is of interest in C++ when functional-style programming is
added e.g. in the form of libraries like <url:
http://spirit.sourceforge.net/distrib/spirit_1_7_0/libs/spirit/phoenix/index.html>.
However I don't know whether Phoenix supports dynamic scoping.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top