unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36547: expect an earlier/clearer error when trying to splice(?) a function into a gexp
@ 2019-07-08 12:33 Robert Vollmert
  2019-07-11 16:06 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Vollmert @ 2019-07-08 12:33 UTC (permalink / raw)
  To: 36547

I tried to use a function in a gexp along the lines of

(define* (f x) …)

#~(begin
     (#$f x)
     …)

This resulted in the following error:

ERROR: In procedure primitive-load:
In procedure scm_lreadr: /gnu/store/wcw0fii855axkiqfz05283rwl7nlrb3i-puzzledb-blogs-job-builder:1:254: Unknown # object: #\<

where the referenced builder file contains

… (let ((backend (#<procedure read-secret (file)> "tools.token"))) …

It seems to me that whatever code writes the builder file should already complain at the point
where it substitutes #<procedure read-secret (file)> — is that possible?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#36547: expect an earlier/clearer error when trying to splice(?) a function into a gexp
  2019-07-08 12:33 bug#36547: expect an earlier/clearer error when trying to splice(?) a function into a gexp Robert Vollmert
@ 2019-07-11 16:06 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-07-11 16:06 UTC (permalink / raw)
  To: Robert Vollmert; +Cc: 36547

Robert Vollmert <rob@vllmrt.net> skribis:

> I tried to use a function in a gexp along the lines of
>
> (define* (f x) …)
>
> #~(begin
>      (#$f x)
>      …)
>
> This resulted in the following error:
>
> ERROR: In procedure primitive-load:
> In procedure scm_lreadr: /gnu/store/wcw0fii855axkiqfz05283rwl7nlrb3i-puzzledb-blogs-job-builder:1:254: Unknown # object: #\<
>
> where the referenced builder file contains
>
> … (let ((backend (#<procedure read-secret (file)> "tools.token"))) …
>
> It seems to me that whatever code writes the builder file should already complain at the point
> where it substitutes #<procedure read-secret (file)> — is that possible?

I think ‘gexp->sexp’ should simply error out whenever an object that
lacks a read syntax (like a procedure) is inserted in a gexp.

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-11 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 12:33 bug#36547: expect an earlier/clearer error when trying to splice(?) a function into a gexp Robert Vollmert
2019-07-11 16:06 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).