From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id EAA25442 for ; Sat, 9 Nov 1996 04:27:21 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA03086; Fri, 8 Nov 1996 12:17:37 -0500 (EST) Resent-Date: Fri, 8 Nov 1996 12:17:37 -0500 (EST) From: Zefram Message-Id: <28077.199611081716@stone.dcs.warwick.ac.uk> Subject: Re: Handling for ZLE modules To: pws@ifh.de (Peter Stephenson) Date: Fri, 8 Nov 1996 17:16:46 +0000 (GMT) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199611081526.QAA01276@hydra.ifh.de> from "Peter Stephenson" at Nov 8, 96 04:26:04 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8393.59 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"eCWJs2.0.8m.lisWo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2343 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >The other question is how to handle unloading. One has to be careful >when bindings remain which point to the function; also, the functions >are in a linear array like the builtin functions and you may not be >deleting at the end. I have arranged it so that the function is >marked as deleted with name "" (which should only be used for >output), but the table entry is kept. I don't like this. Do we retain the binding or not? If not, we have to go through every key binding, changing them to undefined-key. The alternative would be to maintain link counts for loaded bindings, to avoid reusing a slot that is bound to some key. > This seems to me a problem to be fixed in >any script code associated with the (z?)modload -u, No. It's a question of the integrity of zsh's internal data structures, and should be handled by the code itself. On a related note, we really need to make addbuiltin() and so on handle failure cases gracefully. Try loading mod_example.so twice ("modload ./mod_example.so; modload ~+/mod_example.so"): when I tried it it segmentated. Modules are going to have to cope with the possibility that they can't add the builtins, key bindings or whatever that they want. And if anyone's counting, I, too, favour the name `zmodload'. -zefram (Own up, how many of us are planning how to implement autoloaded modules?)