Re: can't export conditional variable set with 'cond'

2024-02-02 Thread Mortimer Cladwell
Thanks all. Both parameters and boxes work for me with guile-3.0.9, which is what I run on my local machine. >> I get the impression that you were asking this more for curiosity about how the language implementation works than to solve a problem I am trying to solve a problem. I have old code run

Re: can't export conditional variable set with 'cond'

2024-02-01 Thread Skyler Ferris
On 2/1/24 16:16, M wrote: > If you are going to reify variables, I would propose boxes instead, which > simply > hold a single value and hence are have very straightforward semantics and are > very close to the semantics of variables. Thanks for bringing that up, I was previously unaware of boxes

RE: can't export conditional variable set with 'cond'

2024-02-01 Thread M
IMO this looks like a minimalised reproducer for a problem encountered in practice. If you are going to reify variables, I would propose boxes instead, which simply hold a single value and hence are have very straightforward semantics and are very close to the semantics of variables. Parameter

Re: can't export conditional variable set with 'cond'

2024-02-01 Thread Skyler Ferris
Hi Daniel, > I think this has something to do with compilation indeed. More specifically, > it is caused by cross module inlining [1]. You probably need to declare your > env module as not declarative by setting #:declarative? to #f inside the > define-module form of env. I think the compiler i

Re: can't export conditional variable set with 'cond'

2024-02-01 Thread Skyler Ferris
It's also worth mentioning that a "lispier" way of doing this is to use parameters, described in "6.11.2 Parameters". I get the impression that you were asking this more for curiosity about how the language implementation works than to solve a problem, but I might be wrong in that assumption an

RE: can't export conditional variable set with 'cond'

2024-02-01 Thread M
>I think this has something to do with compilation indeed. More specifically, >it is caused by cross module inlining [1]. You probably need to declare your >env module as not declarative by setting #:declarative? to #f inside the >define-module form of env. I think the compiler inlines varB some

Re: can't export conditional variable set with 'cond'

2024-02-01 Thread Daniel Meißner
Hi all, Skyler Ferris writes: > On 1/23/24 05:37, Mortimer Cladwell wrote: > > When I run the above I get as output: > > > > "varB post cond: B" > > "varC post if: C" > > "varA in main: A" > > "varB in main:" > > "varC in main: C" > > > > Why can I reset the variables with both 'cond' and 'if' in

Re: can't export conditional variable set with 'cond'

2024-01-24 Thread Skyler Ferris
On 1/23/24 05:37, Mortimer Cladwell wrote: > When I run the above I get as output: > > "varB post cond: B" > "varC post if: C" > "varA in main: A" > "varB in main:" > "varC in main: C" > > Why can I reset the variables with both 'cond' and 'if' in env.scm, but > only the variable reset with 'if' is

Re: can't export conditional variable set with 'cond'

2024-01-23 Thread Damien Mattei
Hello Mortimer, i get in a lot of trouble doing those sort of things with Scheme. i mean trying like in C , expecting to have exported variable , in a object file , and thinking that they are fixed at an address in memory, even this idea is just an assumption of how i expected things to work. But t

can't export conditional variable set with 'cond'

2024-01-23 Thread Mortimer Cladwell
Hi, Suppose I have the following module "testexport" with the auxiliary module "env.scm", used to set global environment variables: -testexport.scm begin-- (define-module (testexport) #:use-module (ice-9 pretty-print) #:use-module (env) ) (define