guile-user
[Top][All Lists]
Advanced

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

Re: Why does compile discard multiple values?


From: Jean Abou Samra
Subject: Re: Why does compile discard multiple values?
Date: Wed, 10 Aug 2022 15:20:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

Le 10/08/2022 à 15:11, Jean Abou Samra a écrit :


Le 10/08/2022 à 15:01, Jean Abou Samra a écrit :
I can work around that using

((compile `(lambda () ,my-form)
          #:env (current-module)))


Ugh, no, I can't. The form might be a define.

Does anybody know of a workaround?



OK, digging into the implementation, I found

scheme@(guile-user)> (use-modules (system vm loader))
scheme@(guile-user)> ((load-thunk-from-memory (compile '(values 1 2) #:to 'bytecode #:env (current-module))))
$1 = 1
$2 = 2

If someone has a better workaround, I'm still interested.




reply via email to

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