|
From: | Alaric Snell-Pym |
Subject: | Re: [Chicken-users] Autoloading optional dependencies |
Date: | Mon, 13 Sep 2010 09:40:06 +0100 |
User-agent: | Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.1.9) Gecko/20100520 Lightning/1.0b2pre Shredder/3.0.4 |
On 09/13/10 07:52, Felix wrote:
When the toplevel variable passed to `autoload' refers to a module binding, then you have to import it, otherwise it refers to an undecorated toplevel variable.
I've just taken a look at how autoload works. Basically: (autoload foo bar) expands into something roughly like: (define bar (lambda args (require foo) (let ((tmp (global-ref foo#bar))) (set! bar tmp) (apply tmp args)))) ...with some extra stuff in to handle conditions arising and all that. If there's anything fatally wrong with this approach, please say now, as it *seems* to be working OK for Ugarit ;-) ABS -- Alaric Snell-Pym http://www.snell-pym.org.uk/alaric/
[Prev in Thread] | Current Thread | [Next in Thread] |