GNU bug report logs - #73431
Add `setf` support for `stream.el` in ELPA

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Mon, 23 Sep 2024 01:35:01 UTC

Severity: wishlist

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: okamsn <at> protonmail.com, philipk <at> posteo.net, nicolas <at> petton.fr, monnier <at> iro.umontreal.ca, 73431 <at> debbugs.gnu.org
Subject: bug#73431: Add `setf` support for `stream.el` in ELPA
Date: Tue, 29 Oct 2024 19:06:14 +0200
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: monnier <at> iro.umontreal.ca,  okamsn <at> protonmail.com,  philipk <at> posteo.net,
>   nicolas <at> petton.fr,  73431 <at> debbugs.gnu.org
> Date: Tue, 29 Oct 2024 17:09:04 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > > So I guess we want to follow the rule here.  But then - how to provide
> > > the nice example here, without repeating the first sentence of the
> > > generic.  Any idea?
> >
> > Can you point me to the doc strings you are talking about, so I could
> > see their text and the examples you'd like to keep?
> 
> We are discussing the docstring of the implementation of `seq-mapn' for
> streams in "stream.el" (line 342).

Thanks.  But I'm not sure I understand the problem.  If I load both
seq.el and stream.el, and then type "C-h f seq-mapn", I see this:

  seq-mapn is a byte-code-function in ‘seq.el’.

  (seq-mapn FUNCTION SEQUENCES...)

  Return the result of applying FUNCTION to each element of SEQUENCEs.
  Like ‘seq-map’, but FUNCTION is mapped over all SEQUENCEs.
  The arity of FUNCTION must match the number of SEQUENCEs, and the
  mapping stops on the shortest sequence.
  Return a list of the results.


  This is a generic function.

  Implementations:

  (seq-mapn ARG0 (ARG1 stream) &rest CL--ARGS) in ‘~/data/stream-2.3.0/stream.el’.

  Map FUNCTION over the STREAMS.

  Example: this prints the first ten Fibonacci numbers:

    (letrec ((fibs (stream-cons
		    1
		    (stream-cons
		     1
		     (seq-mapn #’+ fibs (stream-rest fibs))))))
      (seq-do #’print (seq-take fibs 10)))

  (seq-mapn FUNCTION SEQUENCE &rest SEQUENCES) in ‘seq.el’.

  Undocumented

The "Undocumented" part at the end aside, I see both the doc string of
defgeneric and the doc string of the implementation for streams,
complete with the example.  The only aspect of this I'd change is the
first line of the doc string for the streams implementation: I'd make
it say

  Implementation of `seq-mapn' for streams.

Other than that, everything looks good, and "M-x apropos" shows only
the generic function.

What problem did you try to solve?




This bug report was last modified 264 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.