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

stateful run_expr #943

Open
ide5kllc opened this issue Nov 9, 2022 · 0 comments
Open

stateful run_expr #943

ide5kllc opened this issue Nov 9, 2022 · 0 comments

Comments

@ide5kllc
Copy link

ide5kllc commented Nov 9, 2022

let vm = gluon::new_vm();
vm.get_database_mut().set_implicit_prelude(true);
vm.run_io(true);

vm.run_expr::<()>("ex", r#"
  let x = 23
  ()
"#);

vm.run_expr::<i32>("ex", r#" x "); 

This gets me an error of "UndefinedVariable".

If I want do something "repl-like" where we define something in one command, then reference it in the next, is that possible in gluon ?

I tried reading https://github.com/gluon-lang/gluon/tree/master/repl/src but then got confused when it loads up https://github.com/gluon-lang/gluon/blob/master/repl/src/repl.glu

I'm trying to get a gluon REPL-ish to run on Chrome/wasm. Thus, I can't rely on the "io" stuff for now.

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

1 participant