[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static vs. dynamic scoping

From: Marc Herbert
Subject: Re: static vs. dynamic scoping
Date: Thu, 11 Nov 2010 10:25:13 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101027 Fedora/3.1.6-1.fc13 Thunderbird/3.1.6

>> Examples?
>> http://fvue.nl/wiki/Bash:_Passing_variables_by_reference , I like that.

Very interesting. This reminds me of reflection in Java. Something
difficult and dangerous to use, so you never use it directly. Instead
you ask a framework or a library ( ~= "upvar" ) to use reflection for
you. Unlike your code, such a framework has been developed and
approved by wizards and tested by millions of users.

The analogy unfortunately stops here: you cannot use reflection
by accident, whereas in shell it looks easy to accidentally stumble
on dynamic scoping.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]