bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11328: 24.1.50; Comment in `dired-copy-file-recursive' code


From: Drew Adams
Subject: bug#11328: 24.1.50; Comment in `dired-copy-file-recursive' code
Date: Wed, 25 Apr 2012 09:26:18 -0700

> Fluid variables are a Scheme thing (more, generally, a
> functional-programming thing).  "Dynamically-scoped free 
> variable" would be a reasonable thing to replace it with.

Bof!

Googling just a bit suggests that a fluid variable is more or less a dynamically
scoped variable.  That does not at all make it a _free_ variable.  The variable
occurrences noted in this code were free - no matter how scoped.  Free in lambda
calculi, free if dynamically scoped, free if lexically scoped.  Free variables.
And that is presumably why the comments were inserted: to point out to readers
that the occurrences are not bound locally.

> finding out what a fluid is once you see that is a matter of
> ten seconds looking in, say, the Guile manual.

No, it is not a matter of ten seconds.  And the term "fluid variable" does not
even appear in the Guile manual.

The closest the manual comes, AFAICT, is this: "Fluids can also be used to
simulate the desirable effects of dynamically scoped variables."  NB: "also" and
"simulate" and only certain "effects of".

IOW, the Guile manual does not even say that a fluid is a dynamically scoped
variable, let alone a d-s _free_ variable.  A fluid is said to be an object that
can store one value per dynamic state.  The claim wrt dynamic scoping is only
that, among its various uses, a fluid can simulate some of the effects of a
dynamically scoped variable.

(The Guile manual, BTW, distinguishes fluid vars from "parameters", which it
says are "like dynamically bound variables in other Lisp dialects".  The
distinction being apparently that parameters are per-thread.)

Anyway, this is not Guile - or Scheme of any sort.

In the same vein, here is a quote from Emacs Wiki, presumably written by a
Schemite.  It indicates a similar parochialism:

  "Scheme was the first language to introduce lexical binding. ...
   Variables subject to dynamic binding are usually referred to as
   `fluid variables' or `parameters' on these systems."

(http://www.emacswiki.org/emacs/DynamicBindingVsLexicalBinding#Scheme)

In the Beginning there was The Scheme...  First to introduce lexical binding,
indeed!

But even if dynamically bound variables are "usually" referred to as "fluid
variables" among Scheme enthusiasts, that is no reason to suppose that Computer
Science or programming practice in general refers to them that way.  And anyway,
the code comments I commented on are about _free_ variable occurrences.  They do
not simply point out variables that are dynamically scoped.

FWIW, the `librep' manual says that "fluid variables" aka fluids are another
"method of implementing dynamically scoped variables."  The sole purpose of such
an object, it claims, is "to provide a location from which dynamic bindings may
be created."

(And yet librep's claim to fame is that it has improved on Emacs Lisp in this
way: It "was originally inspired by Emacs Lisp.  However one of the main
deficiencies of elisp--the reliance on dynamic scope--has been removed."
Removed ... and then implemented, it seems, using fluids.)

FWIW, here's a Joulist characterization of fluid variables, which claims that
Scheme has _no_ fluid variables:

 "A fluid variable is a symbol and cell that is established as part
  of the current environment.  When a fluid variable (symbol) is
  referenced the current nest of environments is searched for a
  fluid variable with the matching symbol. The first such match
  provides the cell that satisfies the reference.  This really means
  that each continuation embodies a set of fluid bindings.  Many uses
  of continuations, for which they were reified, are incompatible
  with fluid variables.  One such use is time-slicing.
  Scheme has no fluid variables."

http://www.cap-lore.com/Languages/Global.html

The same article mentions global vars, static class vars, "fluid variables in
Common Lisp", and dynamically scoped vars as being "related".  I personally have
not seen "fluid variable" used wrt Common Lisp, which AFAIK calls it a "special
variable".

In short, I do not see where, even in the limited world of Scheme or Guile, a
free variable occurrence is a "fluid variable" or vice versa.  No, I am no
expert on SkemeSpeke.  But I can usually recognize a free variable when I see
one.

Mea culpa: I googled for "fluid variable" before filing the bug, and it seemed
that the term was essentially limited to fluid mechanics.  So I guessed
(wrongly) that its use here might have been a mistranslation from some other
natural language to English.  I did not guess that it was simply the _use_ of
another language, unnatural, and not a translation at all.

So let me translate my bug report: time to translate to English.  These are
_free_ variable occurrences.






reply via email to

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