[Top][All Lists]

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

Re: streams are cool, you could stream virtually anything!

From: Michael Heerdegen
Subject: Re: streams are cool, you could stream virtually anything!
Date: Fri, 06 Nov 2015 03:47:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

John Wiegley <address@hidden> writes:

> I'd prefer `stream-car', myself. Maintaining consistency of
> nomenclature between "in memory lists" and "generated lists" (aka,
> streams) makes it very intuitive to pick the right name. And there
> will be many new ones to come.  This is a mine rich and waiting.

Are you really speaking about what had been discussed here,
i.e. somewhat like this:

--8<---------------cut here---------------start------------->8---
(defmacro stream-pop (place)
  "Return the first element of the stream stored in PLACE.
Set PLACE to it's `stream-cdr'."
  `(if (stream-empty-p ,place)
       (signal 'some-new-error-type nil)
     (prog1 (stream-first ,place)
       (cl-callf stream-rest ,place))))
--8<---------------cut here---------------end--------------->8---

or about what is currently named `stream-first'?  When you want the
above pop thing to be named `stream-car', I don't understand your

If not: FWIW, personally I prefer `stream-first' and `stream-rest' to
`stream-car' and `stream-cdr' because these different names underline
that streams are not conses.  And that's an important aspect to keep in
mind.  In particular, streams are immutable, but a function named
`stream-car' would somehow suggest the opposite.  Not only are names
important to be mnemonic; they are also a way for the user to build a
mental model, and that should not lead him to problematic analogies.


reply via email to

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