Anyone to help with .sls/.sld files? Artyom Bologov (30 Aug 2024 13:29 UTC)
Re: Anyone to help with .sls/.sld files? Amirouche (30 Aug 2024 14:32 UTC)
Re: Anyone to help with .sls/.sld files? Lassi Kortela (30 Aug 2024 15:45 UTC)
Re: Anyone to help with .sls/.sld files? Artyom Bologov (30 Aug 2024 18:27 UTC)
Re: Anyone to help with .sls/.sld files? Lassi Kortela (30 Aug 2024 19:29 UTC)
Re: Anyone to help with .sls/.sld files? Lassi Kortela (30 Aug 2024 20:50 UTC)
Re: Anyone to help with .sls/.sld files? Artyom Bologov (31 Aug 2024 00:03 UTC)
Re: Anyone to help with .sls/.sld files? Retropikzel (31 Aug 2024 14:17 UTC)
Re: Anyone to help with .sls/.sld files? Arthur A. Gleckler (31 Aug 2024 16:02 UTC)

Re: Anyone to help with .sls/.sld files? Lassi Kortela 30 Aug 2024 20:49 UTC

AFAICT the main task is that you should break down impl.generic.scm into
files like this:

generic-arg.scm
generic-let.scm
generic-lambda.scm
generic-values.scm

And then edit the library to look something like this:

(define-library (srfi 253)
   (export ...)
   (cond-expand
    ...
    (gauche
     (import (except (gauche base) check-arg))
     (include "gauche.scm")
     (include "generic-lambda.scm")
     (include "generic-let.scm")
     (include "generic-values.scm"))
    ...
    (kawa
     (import (kawa base))
     (include "kawa.scm")
     (include "generic-arg.scm")
     (include "generic-let.scm"))
    ...
    (r7rs
     (import (except (gauche base) check-arg))
     (include "gauche.scm")
     (include "generic-lambda.scm")
     (include "generic-let.scm")
     (include "generic-values.scm"))))

The idea is that you build up the complete library from small blocks,
such that for each cond-expand branch each identifier is defined only once.

My illustration has surely got the details wrong, but the principle
holds. If it gets annoying to deal with too many little files, remember
Rob Pike's maxim that "A little copying is better than a little dependency."

It helps to keep things under intellectual control if there's only one
cond-expand, as in the example above. cond-expand is exactly like #ifdef
in the C language, and the same pitfalls apply. In particular, nested
#ifdef (and hence nested cond-expand) gets confusing quickly.