From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: streams are cool, you could stream virtually anything! Date: Thu, 5 Nov 2015 23:05:16 +0000 Message-ID: References: <87ziyuaqhl.fsf@petton.fr> <87fv0labbf.fsf@web.de> <87y4eda0kl.fsf@petton.fr> <8737wl9w5f.fsf@web.de> <87bnb8kd82.fsf@petton.fr> <87wptwirxw.fsf@petton.fr> <877flwl7ee.fsf@web.de> <87y4ecglb5.fsf@petton.fr> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11405aea0424660523d3299c X-Trace: ger.gmane.org 1446764749 9543 80.91.229.3 (5 Nov 2015 23:05:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Nov 2015 23:05:49 +0000 (UTC) Cc: Michael Heerdegen , raman , emacs-devel To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 00:05:48 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZuTbI-00042F-Er for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2015 00:05:48 +0100 Original-Received: from localhost ([::1]:35754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuTbH-0003ps-OJ for ged-emacs-devel@m.gmane.org; Thu, 05 Nov 2015 18:05:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuTao-0003pc-U7 for emacs-devel@gnu.org; Thu, 05 Nov 2015 18:05:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuTan-0004CV-QE for emacs-devel@gnu.org; Thu, 05 Nov 2015 18:05:18 -0500 Original-Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:34394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuTan-0004CR-Iy for emacs-devel@gnu.org; Thu, 05 Nov 2015 18:05:17 -0500 Original-Received: by lfgh9 with SMTP id h9so64499155lfg.1 for ; Thu, 05 Nov 2015 15:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=KtV0xzZVAm2Eu5KlFXVsg+A8H7fbZX8wjetlWpEGuhw=; b=mYw3oWkau1hV8Hn0Vxa0VzpHmOWrM3+NQzNXk+qD71jNhiCHVQ4bAsWn84lBoJ7384 gsQgzbrPagsIq/hf7tUSwAYucMoQgaNgOmhjHE9hi0qTcfnU/q0zbSyk3VlQ2hVvBJZs +c83mxqbH+v8xSOPmTR8MZG9geSk09+WJr8ox5kQ7NpE5IjiQN/dsWuoCKJDpP/iH98H 54L6SR6+z+cDNt9nwfRaiu8K07xGcfO1QlogdjUGbV0JlollBddZMzFsKByHFfdbtdNo X1S3RPY4YCHF/DGVrI4u2RwR0RgThvHWAHO5dGb4cMzc8EaoXmNJu0ZAOxTG8hg6MtbS G29w== X-Received: by 10.25.21.70 with SMTP id l67mr2295529lfi.27.1446764716759; Thu, 05 Nov 2015 15:05:16 -0800 (PST) Original-Received: by 10.112.63.70 with HTTP; Thu, 5 Nov 2015 15:05:16 -0800 (PST) Original-Received: by 10.112.63.70 with HTTP; Thu, 5 Nov 2015 15:05:16 -0800 (PST) In-Reply-To: <87y4ecglb5.fsf@petton.fr> X-Google-Sender-Auth: q9UBlu5VaD0dN_-0E1zTqbOrH2U X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c07::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193353 Archived-At: --001a11405aea0424660523d3299c Content-Type: text/plain; charset=UTF-8 On 5 Nov 2015 9:58 pm, "Nicolas Petton" wrote: > > Michael Heerdegen writes: > > > We can do the very same for streams; just use `stream-cons' instead of > > `cons': > > > > --8<---------------cut here---------------start------------->8--- > > (defmacro stream-push (newelt place) > > "Add NEWELT to the stream stored in PLACE. > > This is equivalent to (setf PLACE (stream-cons NEWELT PLACE))." > > `(cl-callf2 stream-cons ,newelt ,place)) > > --8<---------------cut here---------------end--------------->8--- > > > > Would that be ok? > > I guess so, as long as we don't add too many such functions. I dunno. The way I think of streams it makes perfect sense to have a pop without a push. But maybe that's just me. You could call it stream-next or something like that, so people won't be confused by the lack of push. --001a11405aea0424660523d3299c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 5 Nov 2015 9:58 pm, "Nicolas Petton" <nicolas@petton.fr> wrote:
>
> Michael Heerdegen <mich= ael_heerdegen@web.de> writes:
>
> > We can do the very same for streams; just use `stream-cons' i= nstead of
> > `cons':
> >
> > --8<---------------cut here---------------start-------------&g= t;8---
> > (defmacro stream-push (newelt place)
> >=C2=A0 =C2=A0"Add NEWELT to the stream stored in PLACE.
> > This is equivalent to (setf PLACE (stream-cons NEWELT PLACE)).&qu= ot;
> >=C2=A0 =C2=A0`(cl-callf2 stream-cons ,newelt ,place))
> > --8<---------------cut here---------------end---------------&g= t;8---
> >
> > Would that be ok?
>
> I guess so, as long as we don't add too many such functions.

I dunno. The way I think of streams it makes perfect sense t= o have a pop without a push. But maybe that's just me. You could call i= t stream-next or something like that, so people won't be confused by th= e lack of push.

--001a11405aea0424660523d3299c--