[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Down with Upvalues
- From: dolfi <dolfi@...>
- Date: Thu, 30 Aug 2001 14:45:33 +0200
"John D. Ramsdell" wrote:
> Edgar Toernig <email@example.com> writes:
> > Well, lexical and dynamic scope are the two basic scoping rules.
> > Not opposing rules but two sets that can exist together.
> Are you asking if a language can have both lexically scoped and
> dynamically scoped variables at the same time? Yes, this is true, but
> a language that allows some dynamic variables is not considered to be
> static or lexically scoped.
I would vote that such a language is both. Consider fluid-let in some
Schemes which does dynamic binding as opposed to the static bindings
created by let... and lambda, e.g.:
(define stdout (current-output-port))
(define (wrstdout x) (write x stdout))
(fluid-let ((stdout (open-output-file "redirected-output"))) (wrstdout
I'd say it's not so much a question of the language but of the
variables. One is lexically bound and the other is dynamically bound.
Adolf Mathias EMail: dolfi at zkm dot de Web: www.zkm.de
|||| / |< ||| ZKM Basic Research - Grundlagenforschung
P.B. 6919 D-76049 Karlsruhe, Germany; fon +49 721-8100-1511, fax -1509