emacs-tangents
[Top][All Lists]
Advanced

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

Re: 2016-05-23 Emacs News


From: Rolf Ade
Subject: Re: 2016-05-23 Emacs News
Date: Fri, 10 Jun 2016 15:37:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Nicolas Richard <address@hidden> writes:
> Rolf Ade <address@hidden> writes:
>> (That is:
>> http://mbork.pl/2016-05-23_Literal_values_and_destructive_functions)
>> 
>> Wait, what?
>> [...]
>> in *Messages*. Could someone please explain that to me?
>
> The article you're referring to explains just that. Is it somehow
> unclear ? Quoting the article:
>
> | What’s going on?
> | 
> | Well, the literal in the function definition was actually changed. (If
> | you evaluate the defun form now, it will be redefined once again to
> | the “correct” value.) If you don’t believe it, try this: M-:
> | (symbol-function #'destructive-havoc), or even better, M-x
> | pp-eval-expression RET (symbol-function #'destructive-havoc) RET and
> | see for yourself.

Well ..., sorry, yes, that explanation isn't clear to me. While I'm
far away to claim I'm a versed emacs lisp programmer, I've written a few
screen full of emacs lisp code. Now this thing left me back with the
feeling, that I've missed to understand something at the core of the
language (with the additional unpleasant feeling, that my emacs lisp
programming is even more cargo cult coding, than I already suspected).

The "explanation", that the literal in the function definition was
changed by the (sort) call doesn't help me on track. While I'm fluent
with other programming languages, that are able to rewrite function
definitions during run-time I don't know a programming language that do
this as a 'side effect' of a function call (other than you craft one,
that deliberate does so).

Is what the article demonstrates something special to the 'build-in'
function sort or to emacs lisp? It would help me, if someone explains
what happen in this example in other words (not in implementation detail
but language concepts).




reply via email to

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