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

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

cl-lib questions (was: Re: Screenshots, frame shots straight from Emacs)


From: Emanuel Berg
Subject: cl-lib questions (was: Re: Screenshots, frame shots straight from Emacs)
Date: Wed, 21 Jul 2021 23:44:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier wrote:

>> The byte compiler did not complain after making the change.
>> I didn't investigate further, but suspect that the
>> requirement is unneeded.
>
> Quite likely (unless it so happens that the package relies
> on one of those `cl` features which were incorporated into
> core when `cl-lib` was introduced, the main such feature
> being `setf`).

Can you perhaps say a couple of words on the intended use for
`setf', I get it it is a generic function (macro) but is there
in your mind say one or two typical use cases or something
like that to exemplify?

Also, what is the difference between setf and `setq' with
respect to setting `let'/`let*' variables?

E.g.,

  (let ((x "the truth is out there"))
    (setf x "with a special flavor for YOU")
    x)

  (let ((x "the truth is out there"))
    (setq x "with a special flavor for YOU")
    x)

both of which evaluate to "with a special flavor for YOU" ?

Another cl-lib question is the type of clause usable with
`cl-loop' that are described like this in the docstring:

  Accumulation clauses:
    collect/append/nconc/concat/vconcat/count/sum/maximize/minimize FORM
    [into VAR]

The reason I ask this here is that I have tried to use that
many times in order to not have setq/setf in loops, which you
BTW said were virtually equivalent in that setting IIRC, so my
question in, is it possible to use accumulation clauses
instead, and if so, how, and if not, then when, for what
purpose, and how are you supposed to use them?

TIA

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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