zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: PATCH: parameter substitution for exclusion by array
Date: Sat, 21 Apr 2012 14:48:17 -0700	[thread overview]
Message-ID: <120421144817.ZM10783@torch.brasslantern.com> (raw)
In-Reply-To: <20120420202051.367d012e@pws-pc.ntlworld.com>
In-Reply-To: <20120421220543.29adea5a@pws-pc.ntlworld.com>

On Apr 20,  8:20pm, Peter Stephenson wrote:
}
}       # Filter out functions already loaded or marked for autoload.
}       args=(${args:#(${(kj.|.)~functions})})
} 
} So I thought about an operation that would remove elements of an array
} using another array and, serendipitously, the new implementation of
} uniqarray(), or rather the hash table that goes with it, is exactly
} what's needed to do this efficiently, since it's the same problem but
} with two arrays instead of one.

There isn't anything magic about the hash created by newuniqtable(),
unless you mean that it never frees any of the entries put into it.

(Based on 30391 newuniqtable could lose disablehashnode/enablehashnode
as well?  Not that they hurt anything by being there.)

} I thought of using ${...:~...} for this, but unfortunately ~ can
} introduce an arithmetic expression, so this introduces an ambiguity with
} index offset notation.  So I picked ${...:|...}, which has a double
} mnemonic: bar the "or" of the array and currently always producds an
} invalid expression.

This is nice and there are probably a LOT of places in completion that
could benefit from it.  Particularly in _git, as I recall, where we
fell back to external processes for cache deduplication efficiency.

On Apr 21, 10:05pm, Peter Stephenson wrote:
}
} > Index: Completion/Zsh/Command/_typeset
} >        args=(${^fpath}/*(:t))
} 
} I wonder if it would be OK to fix this to
} 
}       args=(${^fpath}/*(-.:t))
}  
} or is that going to give problems with network paths?

As we're already globbing in the directory, the only difference between
*(-.:t) and *(.:t) is for directories that contain a bunch of symlinks;
any symlink to the directory itself must already have been followed.  So
I don't think network paths are a huge concern.


  reply	other threads:[~2012-04-21 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 19:20 Peter Stephenson
2012-04-21 21:05 ` Peter Stephenson
2012-04-21 21:48   ` Bart Schaefer [this message]
2012-04-21 22:06     ` Peter Stephenson
2012-04-22 12:55 ` Mikael Magnusson
2012-04-22 18:20   ` Peter Stephenson
2012-04-23 13:54     ` PATCH: NEWS: mention new array operations Mikael Magnusson

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=120421144817.ZM10783@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).