all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Nicolas Petton <petton.nicolas@gmail.com>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: Including some functions from dash.el in Emacs?
Date: Wed, 29 Oct 2014 08:50:59 -0400	[thread overview]
Message-ID: <jwvd29b9hjg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87wq7j72wz.fsf@gmail.com> (Nicolas Petton's message of "Wed, 29 Oct 2014 08:25:48 +0100")

> think it would be great if Elisp had them builtin, like `flatten`,
> `filter` or `reduce`.

IIUC, `filter' is covered by `cl-remove-if`, and `reduce' is called
`cl-reduce', right?

As for `flatten', all the examples I've seen where it's used have been
either cases where I think that using a different structure would have
made simpler&clearer code (and removed the need for `flatten'), or where
you really really got lucky.

If you think about types, flatten can't make sense for lists (since
lists are typically "lists of <something>" but not "list of list of list
of list of list ..."), so it is only really useful for trees where it
gives you the in-order elements of the tree, so it only works for trees
with no extra meta info.  In those tree cases, I believe that
a tree-traversal-iterator would be more useful.

> Would it make sense to include some of the dash.el functions into Emacs?

I'm in the process of trying to get dash.el included in GNU ELPA.
I haven't decided yet whether or when it should go into Emacs or stay
in GNU ELPA.


        Stefan



  reply	other threads:[~2014-10-29 12:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  7:25 Including some functions from dash.el in Emacs? Nicolas Petton
2014-10-29 12:50 ` Stefan Monnier [this message]
2014-10-29 13:04   ` Rasmus
2014-10-29 13:16   ` Nicolas Petton
2014-10-29 14:06     ` Stefan Monnier
2014-10-29 14:52       ` Nicolas Petton
2014-10-29 16:35         ` Stefan Monnier
2014-10-30  9:24           ` Nicolas Petton
2014-10-30 13:41             ` Stefan Monnier
2014-10-29 14:09   ` raman
2014-10-29 16:36     ` Stefan Monnier
2014-10-30 14:38       ` raman
2014-10-30 15:48         ` Compiling non-Elisp files in ELPA packages (was: Including some functions from dash.el in Emacs?) Stefan Monnier

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=jwvd29b9hjg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=petton.nicolas@gmail.com \
    /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.