Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: parameter substitution for exclusion by array



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.



Messages sorted by: Reverse Date, Date, Thread, Author