zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Add :^ syntax for zipping two arrays
Date: Fri, 01 Aug 2014 09:46:32 +0100	[thread overview]
Message-ID: <20140801094632.6ea87550@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <1406828739-14841-1-git-send-email-mikachu@gmail.com>

On Thu, 31 Jul 2014 19:45:39 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> Any objections to adding this? Comments on the code is also welcome
> since I'm not at all sure I thought of all the gotchas in paramsubst(),
> in particular some allocations might be leaking? Not adding tests until
> any and all comments are incorporated.

That looks pretty reasonable, but I think all the allocations need to be
on the heap at this point (though it's certainly potentially confusing):
so zalloc needs to be zhalloc, ztrdup needs to be dupstring, and mkarray
needs to be... er... however you do mkarray on the heap; I think you
just zhalloc(2), copy the first element, and set the second to
NULL, though I don't see why you couldn't add an hmkarray().

Generally, the command line expansion stuff is all done on the heap ---
it doesn't get turned into permanent allocation until assigned to a
variable, added to a hash, stored as a function definition, or whatever.

Then it looks like it ought basically to work.  Some tests would be
useful.

pws


  reply	other threads:[~2014-08-01 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 17:45 Mikael Magnusson
2014-08-01  8:46 ` Peter Stephenson [this message]
2014-08-01 14:46   ` Mikael Magnusson
2014-08-01 15:02     ` Peter Stephenson
2014-08-01 15:20       ` Bart Schaefer

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=20140801094632.6ea87550@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).