Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting env vars from scheme post 0.7 #273

Open
digego opened this issue Jun 17, 2016 · 4 comments
Open

setting env vars from scheme post 0.7 #273

digego opened this issue Jun 17, 2016 · 4 comments

Comments

@digego
Copy link
Owner

digego commented Jun 17, 2016

can't set env vars from scheme in aot code since 0.7

@JimKuhn
Copy link
Collaborator

JimKuhn commented Jun 17, 2016

It seems to work for me on Linux (at least) (?).

I added this to an aot module:

(impc:aot:do-or-emit
  (define EnvTest
    (lambda ()
      (sys:set-env "dummy_env" "ABC"))))

I then loaded it (post aot-compile) and executed:

(EnvTest)
($ (printf "%s\n" (getenv "dummy_env")))

ABC

@benswift
Copy link
Collaborator

Hi Andy, what do you mean by "can't set env vars from scheme in aot code" - do you mean the scheme wrappers don't work? Because obviously plain scheme (as per Jim's example) is never AOTed.

@digego
Copy link
Owner Author

digego commented Jun 21, 2016

I'm talking about an xtlang closures captured variables. not the shell's
environment variables.

(bind-func test
(let ((x:i64 0))
(lambda ()
(* 2 x))))

;; this works OK for non-ato'd code but not for aot lib
(println (test))
(test.x 5)
(println (test))

;; this always works
($ (println (test)))
($ (test.x:i64 10))
($ (println (test)))

Don't fuss though guys, the note is for me to chase when I have time.

On Tue, Jun 21, 2016 at 11:10 AM, Ben Swift notifications@github.com
wrote:

Hi Andy, what do you mean by "can't set env vars from scheme in aot code"

  • do you mean the scheme wrappers don't work? Because obviously plain
    scheme (as per Jim's example) is never AOTed.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#273 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAh3qVopFryUtReUlJpL2fvEKEpszQI1ks5qNzoKgaJpZM4I375-
.

@benswift
Copy link
Collaborator

Ok, cool.
Andrew Sorensen notifications@github.com writes:

I'm talking about an xtlang closures captured variables. not the shell's
environment variables.

(bind-func test
(let ((x:i64 0))
(lambda ()
(* 2 x))))

;; this works OK for non-ato'd code but not for aot lib
(println (test))
(test.x 5)
(println (test))

;; this always works
($ (println (test)))
($ (test.x:i64 10))
($ (println (test)))

Don't fuss though guys, the note is for me to chase when I have time.

On Tue, Jun 21, 2016 at 11:10 AM, Ben Swift notifications@github.com
wrote:

Hi Andy, what do you mean by "can't set env vars from scheme in aot code"

  • do you mean the scheme wrappers don't work? Because obviously plain
    scheme (as per Jim's example) is never AOTed.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#273 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAh3qVopFryUtReUlJpL2fvEKEpszQI1ks5qNzoKgaJpZM4I375-
.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#273 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants