unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: change pcomplete/make to include targets in included files
Date: Mon, 16 Sep 2019 16:33:29 -0700	[thread overview]
Message-ID: <86woe7rf3q.fsf@stephe-leake.org> (raw)
In-Reply-To: <jwvd0g1nuxd.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 15 Sep 2019 16:56:00 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> That doesn't seem to work. The list ('rules' in
>> pcmp-gnu-with-file-buffer) is initially nil, which means it is not
>> passed by reference, so it is never updated. Unless there is some way to
>> force pass by reference? (I think that requires a macro?)
>
> I definitely don't want to pass anything by reference (I like things to
> be immutable).  I meant you should be doing
>
>     (setq targets (pcmpl-gnu-make-all-targets ... targets))
>
> instead of
>
>     (setq targets (append (pcmpl-gnu-make-all-targets ...)
>                           targets))
>
> it's a standard coding style in functional programming (except
> using recursion rather than while+setq, of course).

Ah; you can do 'push' on the 'targets' arg (whether nil or otherwise),
then return it. That makes sense. 

-- 
-- Stephe



      reply	other threads:[~2019-09-16 23:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-14  9:46 change pcomplete/make to include targets in included files Stephen Leake
2019-09-14 10:08 ` Eli Zaretskii
2019-09-14 10:57   ` Eli Zaretskii
2019-09-14 22:04     ` Stephen Leake
2019-09-14 22:03   ` Stephen Leake
2019-09-15  1:43 ` Stefan Monnier
2019-09-15 19:50   ` Stephen Leake
2019-09-15 20:56     ` Stefan Monnier
2019-09-16 23:33       ` Stephen Leake [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86woe7rf3q.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).