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

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

RE: [External] : Re: Mutation - do you understand it really?


From: Drew Adams
Subject: RE: [External] : Re: Mutation - do you understand it really?
Date: Thu, 19 Jan 2023 17:47:38 +0000

> In Haskell you can't change variable bindings like in Lisp.  You
> program in a completely different style.  Read an introduction into
> Haskell if you are interested, then you'll understand the reaction.

Yes - _completely_ different style, behavior, and
meaning.

This isn't specific to Haskell.  But sure, that's
a good example of a popular programming language
that's _purely_ functional.

(We should just say "functional", but that term
has come to encompass even languages such as Lisp,
and it pretty much just means languages that
emphasize expression evaluation, with nesting and
return values.)

Languages that are purely functional (or purely
logic(al)) use variables only in the _math_ sense:
the value of a variable doesn't "vary".  Variables
aren't memory locations that are assigned values
(more than once).  In a given definitional context
a variable has the same value everywhere.  Same
thing for function names.

That, however, with the proviso that at the _top_
level such languages typically _do_ treat function
names, and sometimes variable names, dynamically,
i.e., as dynamic variables - variables in the
traditional programming (assignment) sense: memory
locations to be filled and refilled.  E.g., you
can redefine a function.  There's no `let' at the
top level, within which everything is defined.

Note that Lisp - even "pure" lisp: only lexically
scoped etc. - isn't a purely functional language.
The mere presence of `quote' makes it referentially
opaque.  And even applicative evaluation order is a
problem - not what you want in a useful functional
language, in general.

Lisp isn't lambda calculus or combinatory logic.
And it doesn't pretend to be.  Its impurity isn't
shamefaced. ;-)  Lisp is, well, loosey-goosey.




reply via email to

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