[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".
- Patch: perform autoloading when docs is missing from autoload object, Arthur Miller, 2021/09/15
- Re: Patch: perform autoloading when docs is missing from autoload object, Stefan Monnier, 2021/09/15
- Re: Patch: perform autoloading when docs is missing from autoload object, Arthur Miller, 2021/09/17
- Re: Patch: perform autoloading when docs is missing from autoload object, Stefan Monnier, 2021/09/18
- Re: Patch: perform autoloading when docs is missing from autoload object, Arthur Miller, 2021/09/18
- Re: Patch: perform autoloading when docs is missing from autoload object, Stefan Monnier, 2021/09/20
- Re: Patch: perform autoloading when docs is missing from autoload object, Arthur Miller, 2021/09/22
Re: Patch: perform autoloading when docs is missing from autoload object, Lars Ingebrigtsen, 2021/09/16