From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16349 invoked from network); 30 Jun 2006 12:57:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jun 2006 12:57:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 11554 invoked from network); 30 Jun 2006 12:57:36 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jun 2006 12:57:35 -0000 Received: (qmail 27583 invoked by alias); 30 Jun 2006 12:57:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10457 Received: (qmail 27574 invoked from network); 30 Jun 2006 12:57:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Jun 2006 12:57:27 -0000 Received: (qmail 10401 invoked from network); 30 Jun 2006 12:57:27 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 30 Jun 2006 12:57:25 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly14d.srv.mailcontrol.com (MailControl) with ESMTP id k5UCuql3018390 for ; Fri, 30 Jun 2006 13:57:19 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Jun 2006 13:56:57 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k5UCuvC9025603 for ; Fri, 30 Jun 2006 13:56:57 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k5UCuu32025600 for ; Fri, 30 Jun 2006 13:56:57 +0100 Message-Id: <200606301256.k5UCuu32025600@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: zsh libs In-reply-to: <20060630124048.GA18152@ulpmm.u-strasbg.fr> References: <20060630124048.GA18152@ulpmm.u-strasbg.fr> Date: Fri, 30 Jun 2006 13:56:56 +0100 From: Peter Stephenson X-OriginalArrivalTime: 30 Jun 2006 12:56:57.0931 (UTC) FILETIME=[ABB801B0:01C69C44] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-00-10 (www.mailcontrol.com) on 10.68.0.124 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 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