chicken-hackers
[Top][All Lists]
Advanced

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

Re: [PATCH 0/3] Clarify built-in library/SRFI feature behaviour


From: Evan Hanson
Subject: Re: [PATCH 0/3] Clarify built-in library/SRFI feature behaviour
Date: Tue, 19 Oct 2021 12:09:59 +1300

On 2021-10-18 13:31, felix.winkelmann@bevuta.com wrote:
> As far as I can tell builtin-features has simply been dropped. How do you
> avoid having 'srfi-9 as a requirement?

Yeah, that's what the second patch is all about. Since SRFI-9 is a
syntax-only module (defined in modules.scm), we can no-op right away
when it's imported by marking the module as having "no library" rather
than needlessly introducing a `##core#require` form during expansion
only to ignore it later during compilation. The same goes for srfi-0, 2,
6, etc. all of those primitive modules. There are fewer moving parts
this way, less code involved.

> I also don't fully understand why you try so hard to void the multiple value
> return of ##sys#process-require. It's not particularly elegant, I admit, but
> it looks like the obvious solution here to centralize the decision of what
> to do with a requirement ID.

Elegance partly, yes, but I also think it is just easier to understand
this way. That second value is only used in one place, in core.scm. It's
totally ignored in eval.scm and only adds noise to the code there. So,
the value is being introduced apart from where it's used, and you have
to look in both places to understand what it represents. Because it's
only core.scm that needs to determine whether a library is part of core,
and we control both sides of this "API" (such as it is), we can separate
the tasks and give a better name to the procedure that does this (that
is what "core-library?" is for), and call it directly.

I'm proposing this because, having gone through the "how is code loaded"
machinery a while back, I remember how hard it was to understand some
parts of it. The multi-values approach seems needlessly indirect to me,
per the above, so I was just looking for ways to clarify things further,
building on your changes.

Evan



reply via email to

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