emacs-devel
[Top][All Lists]
Advanced

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

Re: master 95fee880e45 1/4: New macros incf and decf


From: Philip Kaludercic
Subject: Re: master 95fee880e45 1/4: New macros incf and decf
Date: Fri, 28 Feb 2025 07:29:42 +0000

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> +The DELTA is first added to PLACE, and then stored in PLACE.
>>>> +Return the incremented value of PLACE.
>>>> +
>>>> +See also `decf'."
>>>> +  (declare (debug (gv-place &optional form)))
>>>> +  (gv-letplace (getter setter) place
>>>> +    (funcall setter `(+ ,getter ,(or delta 1)))))
>>>> +
>>>
>>> Out of curiosity, is there any significance to the usage of
>>> `gv-letplace' here?  Or would `setf' have done the same job?
>>
>> I can't come up with any counter-examples off the top of my head, but I
>> think they might exist.
>>
>> Copying in Stefan Monnier, who wrote that code.
>
>     (cl-incf (aref my-array (random 6)))

Of course, thanks!

>
> - Stefan



reply via email to

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