Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh libs
- X-seq: zsh-users 10457
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: zsh libs
- Date: Fri, 30 Jun 2006 13:56:56 +0100
- In-reply-to: <20060630124048.GA18152@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060630124048.GA18152@xxxxxxxxxxxxxxxxxx>
Marc Chantreux wrote:
> hello,
>
> Few days ago, Nikolai Weibull told us about autoload to deal with
> namespaces. I'm trying to use this tips for my own libs.
>
> I load my new lib with autoload -U but when i execute the function for
> the first time, it wasn't executed.
>
> does anyone knows why ?
>
>
> > fpath+=$PWD
> > cat ldap/new
> #autoload ldap/read ldap/write ldap/new
>
> ldap/new () { print "new ..." }
> ldap/read () { print "reading ..." }
> ldap/write () { print "writting ..." }
In zsh's standard form of autoload the file contains just the function
body, so that all that happens when it's first executed is that the
functions contained inside are defined. This is different from other
shells.
However, it's simple to convert the file you've got: just add
ldap/new "$@"
to the end of the file.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author