GNU bug report logs -
#55464
(current-filename) is #f when guix pull'ing
Previous Next
Full log
View this message in rfc822 format
Hi,
Attila Lendvai <attila <at> lendvai.name> skribis:
> the actual context where i'm encountering this is a package definition where i want to load some hashes from a file relative the to the .scm file:
>
> (define-public foo
> (let ((hashes
> (with-input-from-file
> (string-append (dirname (current-filename))
> "/foo.hashes")
> read)))
> (package ...)))
Not fully answering your question, but if “foo.hashes” contains hashes
for origins and similar, you could make “foo.hashes” contain something
like:
(list (base32 …) …)
and, in the .scm, write:
(include "foo.hashes")
The ‘include’ directive includes the file at macro-expansion time,
similar to #include in C.
Back to the original issue, I suppose ‘current-filename’ return #f when
this .scm is first loaded, before it’s compiled. Anyway, it’s probably
best to load it at macro-expansion time as you suggested.
HTH,
Ludo’.
This bug report was last modified 3 years and 24 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.