How to use the jscl as a object in other cases besides the repl example?
noloop opened this issue · comments
I'm confuse how to use it. I need something like this:
const jscl = new jscl();
const result= jscl.eval_string_lisp("(+ 1 1)");
console.log(result); // => 2
But I don't understand how to obtain this or if it is possible.
I tried:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSCL</title>
</head>
<body>
<script src="./JSCL_files/jscl.js" type="text/javascript"></script>
<script>
console.log(jscl.lisp_to_js("(+ 1 1)"));
</script>
</body>
</html>
And I get:
Uncaught TypeError: jscl.lisp_to_js is not a function
at jscl-test.js:2
I hope this project is helpful:
https://github.com/t-cool/jscl-playground
Please load the compiled JS files as in https://jscl-project.github.io and type as below:
> jscl.evaluateString('(+ 1 1)')
2
Thanks