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

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

bug#15117: 24.3.50; doc of `(forward|backward)-*': state return value


From: Andreas Röhler
Subject: bug#15117: 24.3.50; doc of `(forward|backward)-*': state return value
Date: Tue, 11 Feb 2014 11:52:23 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 11.02.2014 05:01, schrieb Stefan Monnier:
These are NOT side-effect functions.  They modify nothing except
the cursor position.
How is that not a side-effect?
You are clearly arguing for the sake of arguing, now.

Not at all.

Motion functions are not what is typically meant by a side-effect
function.

Says you.  For me (and most definitions of side-effects I've ever seen),
a side-effecting function is something like a function where the calls
can't simply be replaced by their return value.



Can't see a logic link between a possible return value and the notion of 
side-effect.
It all depends from the purpose of the function.

Avoiding side-effects as a goal tries to avoid complexity.

While asking for (documented) return-values some times ago, being well aware 
these might constitute side-effects - but must not.
I.e. if a move-function reaches position, the buffer state is changed, but 
that's not a side effect, as it's the purpose.
If this function returns position for possibly receiving functions, would 
consider it a side-effect.

So if avoiding complexity is a goal, delivering a smart language is another one.
Not all side-effects are of same severity or same urgence to avoid.

Remains to decide. In case of move-functions, being in favor of returning 
position reached.

Documenting return-values is another --quite useful-- thing.

Cheers,

Andreas









reply via email to

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