Re: Anyone to help with .sls/.sld files?
Amirouche 30 Aug 2024 14:32 UTC
Hello Artyom,
Thanks for working on this, I am still procrastinating to comment. Tho, maybe it will help me to help with this issue about the library.
What is the problem with the libraries? Why test.scm does not import (srfi 253)?
By the way, an alternative form of:
;; It's possible that there are *no* audio devices available, in
;; which case open-device throws an exception. In that case, return
;; #f.
(let ((device (false-if-exception (openal:open-device))))
(and device
(%make-sound-system device ...)))
ref: https://github.com/scheme-requests-for-implementation/srfi-253/blob/master/existing-practice.scm#L293
It is possible to use and=> from the builtin guile env, and srfi-26 cut:
(and=> (false-if-exception (openal:open-device))) (cut (sound-system <> ...)))
ref: https://www.gnu.org/software/guile/manual/html_node/Higher_002dOrder-Functions.html#index-and_003d_003e
In that particular case, it is easier to do:
(guard (ex (else #f))
(sound-system (openal:open-device) ...))
The form and=> is terse, handy, less general form of and-let*:
(and-let* ((device (false-if-exception ...)) (sound-system (make-sound-system device ...))) sound-system))
ref: https://srfi.schemers.org/srfi-2/
Hope it helps,
On Friday, August 30th, 2024 at 15:29, Artyom Bologov <xxxxxx@aartaka.me> wrote:
>
>
> Hi y'all,
>
> The SRFI seems to come together nicely. One thing that was always broken
> with it, though: library files (.sls/.sld) are useless and I was unable
> to fix them. Anyone willing to try fixing them? I bet there are better
> Schemers than me on this mailing list.
>
> Thanks a lot!
> --
> Artyom Bologov
> https://aartaka.me