Fixed *ARGV*

Arguments are now srings (were symbols previously)
This commit is contained in:
teo3300
2025-07-23 09:55:21 +09:00
parent 75057723ff
commit a1692214f6
2 changed files with 13 additions and 1 deletions

View File

@ -71,7 +71,18 @@ use rustyline::error::ReadlineError;
use rustyline::DefaultEditor;
pub fn pre_load(argv: &Vec<String>, env: &Env) {
eval_str(format!("(def! *ARGV* '({}))", argv[1..].iter().map(|x| x.to_string() + " ").collect::<String>()).as_str(), &env).unwrap();
eval_str(
format!(
"(def! *ARGV* '({}))",
argv[1..]
.iter()
.map(|x| "\"".to_string() + x + "\" ")
.collect::<String>()
)
.as_str(),
&env,
)
.unwrap();
}
pub fn interactive(env: Env) {

1
test.mal Normal file
View File

@ -0,0 +1 @@
(println *ARGV*)