all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Nicolas Petton <nicolas@petton.fr>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs Development <emacs-devel@gnu.org>
Subject: Re: Stream implementation of seq-mapn
Date: Mon, 18 Dec 2017 13:51:02 +0100	[thread overview]
Message-ID: <87h8sofbd5.fsf@web.de> (raw)
In-Reply-To: <87po7crzce.fsf@petton.fr> (Nicolas Petton's message of "Mon, 18 Dec 2017 13:32:17 +0100")

Nicolas Petton <nicolas@petton.fr> writes:

> > [...]
> > +(cl-defmethod seq-mapn (function (stream stream) &rest streams)
> > +  "Map FUNCTION over the STREAMS.
> I would add to the docstring that all elements of `streams' should be
> streams, otherwise it will default to the generic implementation.

I already had "all the STREAMS must be streams", but that looked weird.


> > +  (if (not (cl-every #'streamp streams))
>                ^^^^^^^^
>                Since this is for stream.el, why not use `seq-every-p'?
> > +      (cl-call-next-method)
> > +    (cl-callf2 cons stream streams)
> > +    (stream-make
> > +     (unless (cl-some #'seq-empty-p streams)
>                  ^^^^^^^
>                  Same question :-)

Ok, done.


> > (1) Is it ok to implement it with `cl-call-next-method' this way?
>
> I guess it is.  Have you tried running `seq-mapn' with a mix of streams
> and lists?

Sure.  I does what I want: the default method is invoked.


Michael.



  reply	other threads:[~2017-12-18 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 11:58 Stream implementation of seq-mapn Michael Heerdegen
2017-12-18 12:32 ` Nicolas Petton
2017-12-18 12:51   ` Michael Heerdegen [this message]
2017-12-18 13:50     ` Nicolas Petton
2017-12-19 13:05       ` Michael Heerdegen
2017-12-19 14:08         ` Nicolas Petton
2017-12-26 22:09           ` Michael Heerdegen
2017-12-29  9:04             ` Nicolas Petton
2017-12-30 14:28               ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8sofbd5.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nicolas@petton.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.