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

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

Re: [External] : Re: operations on path lists


From: Jean Louis
Subject: Re: [External] : Re: operations on path lists
Date: Wed, 8 Feb 2023 23:09:26 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

> > Let us look at `when' little:
> > 
> > - you place `when' when you need `nil' as last resort

The above I was thinking 💭, maybe by mistake, that I am answering to
Swedish friend.

> I don't.  I do just the opposite.  I use `when' and `unless' only
> when the code doesn't use/depend on the return value.  (I'm guessing
> that's what you meant by needing nil as a last resort, though they
> always return nil.)

Thanks, I got your thinking, I like when I enter in your mind with
such details, thanks much. What interesting stuff goes on over
thousands of miles of distance.

Yes, I know those return nil. You got my idea, thanks.

> Before Elisp borrowed `when' and `unless' from other Lisps
> (e.g. Common Lisp), the idiom, especially for a single condition,
> was to use `or' in (or condition do-something) instead of `unless',
> and likewise for `and' and `when'.  That that, usually at top level
> in a function body.  I still have some of those `or' sexps, as does
> standard Emacs code.

Okay, I get the history, thanks.

> > - without parenthesis highlighting sometimes it becomes very difficult
> >   to understand what did `if' author intended to say?
> 
> I don't grok that.

With `cond' I can see, usually, what is meant with the condition, as
it is at least to me better structured than `if', as complexity of
code requires me to count parenthesis or be very careful to understand
which expression belong to which part of `if' or some `if` that
follows up. With parenthesis highlighting that is helped better.

> But then, I don't use `if' unless there are both a then and an else
> part.  I take the time to rewrite, yes, as needed, to communicate to
> myself (as reader) just what the code means to do.

Yes, it is good to communicate to oneself over periods of time, I
forgot already what I was doing back in time, sometimes I study my
program to find out what did I mean with it.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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