Could Emacs be rewritten in Python?

Anders J. Munch andersjm at dancontrol.dk
Fri Apr 11 17:22:19 CEST 2003


"Beni Cherniavsky" <cben at techunix.technion.ac.il> wrote in message 
> 
> So I argue that dynamic scoping done right, unlike simple globals, is
> not always evil.  It's completely equivallent to passing all your
> environment, except that you don't have to write that explicitly,
> which can make all the difference.  Frequently, what you really want
> is to parametrize a *proccess*, not just a specific call.
> 
> For example, in Unix, I/O redirection, the current working directory
> and most other process parameters are dynamically scoped: it's
> implemnented by copying from each process to its children but to you,
> it's just magically inherited.  

And this is a common source of frustration.  Scripts may work fine
from the command line but fail mysteriously when run from init or a
cron job, because somehow the environment is different.  The CWD ought
to have been local to the shell as the notational device for writing
abbreviated filenames that it is; inheriting it just causes problems.
Ever tried replacing "cd somedir; make" with "make -f
somedir/Makefile"?  This will invariably fail because an unexpected
CWD is inherited.

What works well for customising your interactive shell experience does
not work well for programming.

speaking-as-the-author-of-a-lexically-scoped-make-utility-ly y'rs,
Anders

-- 
Anders Munch. Software Engineer, Dancontrol A/S, Haderslev, Denmark
Capon - a software build framework - http://www.dancontrol.net/share/capon/






More information about the Python-list mailing list