From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5785 invoked from network); 1 Mar 2000 16:58:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Mar 2000 16:58:20 -0000 Received: (qmail 5062 invoked by alias); 1 Mar 2000 16:58:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9959 Received: (qmail 5042 invoked from network); 1 Mar 2000 16:58:10 -0000 From: "Bart Schaefer" Message-Id: <1000301165803.ZM31531@candle.brasslantern.com> Date: Wed, 1 Mar 2000 16:58:03 +0000 In-Reply-To: <200003011006.LAA24751@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: wordcode files" (Mar 1, 11:06am) References: <200003011006.LAA24751@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: wordcode files MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 1, 11:06am, Sven Wischnowsky wrote: } Subject: PATCH: wordcode files } } The zcompile builtin can be used to create wordcode files. [...] If } neither -r nor -m are given zcompile decides if the file is to be read } or mapped: if the resulting file (one version of the content, see } below) is less than 4096 bytes long it is read. [...] } } The file created contains two versions: one for either endian-ness. } The shell reading the file will decide which one it needs [...] } } Wordcode files can be used in two ways. One way is to put them into } the directories in $fpath with the .zwc extension. [...] The other way } is to put the name of the wordcode file into $fpath. In that case the } .zwc extension isn't required [...] This all sounds fine, although I lean towards requiring that the .zwc extension appear in the $fpath listing. What happens, for example, if I have both a ~/zshfun/ and ~/zshfun.zwc and I list ~/zshfun in $fpath? } [...] Note also, that such digest files are really only searched when } they appear as elements of $fpath. The shell does not look into every } *.zwc file in every diretory in $fpath [...] This is just fine. } [...] I also find it tempting to turn most of my .z* files (including } the completion dump file) into functions and putting them into a } wordcode file, but I haven't implemented any support for that either. } Maybe we could extend the mechanism with the *.zwc files to also apply } to sourced files -- creating dump files for them is simple, and can be } done already with zcompile, it's just that the function for sourcing a } file does not check if there is a *.zwc file. Should we? What would "source" do if it encountered a function digest file? Simply define all the functions it contains? Perhaps we'd need yet another option to zcompile, to tell it to produce a source-able file instead of a function digest. Then "source" ignores the digest files and autoloading ignores source-able files. Unless we think it'd be useful to have autoloading simply execute the source-able files, but I think that'd have to be limited to the file-in-a-directory case and not the file-named-in-$fpath case. } % zcompile foo ../Completion/*/_*~*~ } % fpath=(foo) } } And then do completion (without having it done before in the same } shell)... the first completions (where normally the functions are } loaded and parsed) should be a lot faster, especially when using the } larger functions like _cvs, _rpm or _pbm. So _cvs is still a function that defines a bunch of other functions and then calls itself? When such a function is loaded from a mapped digest file, the result of executing it is going to be a bunch of functions that have been copied into allocated memory, right? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com