zsh-users
 help / color / mirror / code / Atom feed
* Prepend to array
@ 2022-05-09 20:30 Perry Smith
  2022-05-09 23:45 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Perry Smith @ 2022-05-09 20:30 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

I have no idea where I came up with this but reading the internet and the documentation leads me to think that this isn’t really supported.

> # Add in my own functions
> fpath[1,0]=$ZDOTDIR/functions

It does exactly what I want: it prepends $ZDOTDIR/functions to the front of the fpath array.  I can’t even find an example where the 2nd index is less than the first index.

So, I thought I would ask:

1) Is the above syntax supported or does it just happen to work currently?

2) What is the prescribed method of prepending to an array: e.g.

Before
fpath=( /a/b /c/d )

After
fpath=( /x/y /a/b /c/d )

Thank you for your time,
Perry


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-09 23:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 20:30 Prepend to array Perry Smith
2022-05-09 23:45 ` Bart Schaefer

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).