[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Several beginner-questions
From: |
Pascal J. Bourguignon |
Subject: |
Re: Several beginner-questions |
Date: |
Wed, 28 Mar 2012 19:20:19 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Lowell Gilbert <lgusenet@be-well.ilk.org> writes:
> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> Lowell Gilbert <lgusenet@be-well.ilk.org> writes:
>>> It's certainly possible to write functional programs in Emacs Lisp, just
>>> as in any other Lisp. But any program that uses side effects (changing
>>> a buffer being one obvious example) is not a functional program.
>>
>> And what do you do of the buffer monad?
>
> I don't understand the question.
Purely functionnal programming languages use some kind of monad to
implement state mutation. If you wrote an emacs in Haskell, you
conceivably would have a buffer monad so that you can insert strings and
and move point in a buffer. There is strictly no difference with emacs
lisp, where you can insert string and move point in a buffer. Emacs
lisp implements the buffer monad that Haskell programmers would implement
to write an emacs.
So the meaning of my question is that you cannot critize a program that
uses side effects changing a buffer for not being a functional program,
because a program in a purely functionnal programming language would do
exactly the same, by implementing a buffer monad.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.