From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28835 invoked from network); 28 Mar 2000 11:52:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Mar 2000 11:52:56 -0000 Received: (qmail 20904 invoked by alias); 28 Mar 2000 11:52:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10296 Received: (qmail 20896 invoked from network); 28 Mar 2000 11:52:44 -0000 Date: Tue, 28 Mar 2000 13:52:38 +0200 (MET DST) Message-Id: <200003281152.NAA14996@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Tue, 28 Mar 2000 13:40:32 +0200 (MET DST) Subject: Re: autoload +X[zk] I wrote: > ... > > This works by storing a flag in the eprog for the file read that will > make doshfunc() recurse to execute the function once again on the > first call. Most of the patch just turns the `alloc' field of the > eprog struct into a `flags' field and ensures that the call to the > function (which isn't really in the wordcode) is printed at the end. > > Note also the handling of the positional parameters. For the first > call (i.e.: when the init code from the file is executed) they are not > set. Only for the appended function call are they set up. This is the > behaviour the ksh I have here shows. I wrote that last paragraph after I had written the other stuff and then tested ksh. Damn. That doesn't work, because the printing functions just output `foo "$@"' for the not-really-existing call. Hm. What are we supposed to do here? Handle positional parameters differently? Output a special comment as for the other function flags (but that doesn't work with $functions, but the eprog flag is lost there anyway) or... use another special option for autoload (but that wouldn't work for $functions either because that flag-losing thing). With `work for $functions' I mean: eval "foo() { $functions[foo] }" or some such. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de