Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: reading a file into an array. mapfile? (f)?
- X-seq: zsh-users 13240
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh users mailing list" <zsh-users@xxxxxxxxxx>
- Subject: Re: reading a file into an array. mapfile? (f)?
- Date: Thu, 18 Sep 2008 08:10:16 -0700
- In-reply-to: <6cd6de210809180303n24e8aac7x29f8cabba1c7a74c@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210809171953pd956d75gd4b3609ac036fe0@xxxxxxxxxxxxxx> <080917214418.ZM27616@xxxxxxxxxxxxxxxxxxxxxx> <6cd6de210809180303n24e8aac7x29f8cabba1c7a74c@xxxxxxxxxxxxxx>
On Sep 18, 6:03am, Rocky Bernstein wrote:
}
} I sort of agree with this comment in zshmodules:
} It is unfortunate that the mechanism for loading modules
} does not yet allow the user to specify the name of the shell
} parameter to be given the special behaviour.
}
} Here's how it is done in Ruby which is extremely simple: if there is an
} associative array SCRIPT_LINES__ defined file lines are saved into this
} array when it reads a file.
I think you and the zsh/mapfile manual are talking about two different
things here.
What you seem to be asking for (based on what SCRIPT_LINES__ really
does in Ruby) is to have the zsh script parser stuff the lines it reads
into a variable as it parses them, so that (for example) "autoload"
would magically copy the function text into the SCRIPT_LINES__ array.
The excerpt above means that it's not possible when loading zsh/mapfile
to cause the variable "mapfile" to have a different name. That has
nothing to do with script parsing.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author