emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generic autoloading? [Was Patch: perform autoloading when docs is mi


From: Arthur Miller
Subject: Re: Generic autoloading? [Was Patch: perform autoloading when docs is missing from autoload object]
Date: Fri, 17 Sep 2021 23:25:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Qiantan Hong <qhong@mit.edu> writes:

> Just in case, is it possible to provide a generic autoload mechanism
> that run arbitrary function to load the missing function, 
> instead of hardcoded to basically a REQUIRE?
>
> This can be very helpful for my object capabilities implementation
> because it can be used to support importing object graph more lazily.
> (Instead of needing to traverse a full reference closure of a function,
> we can stop at arbitrary function and resume traversal only when
> that function is called).
>
> Currently I can fake it with a closure that knows where it is
> and replace itself once called.
That is what autoloads does in principle. Autoload is just a stub in funcion
slot of a symbol that loads the library where object is placed.
> But it feels like reimplementing the same thing twice.
Yes it sounds similar in essence, but you are doing this probably from memory,
autoloads are to save cpu time and speed by delay-loading from the disk "on
demand".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]