Skip to content
VitoVan edited this page Apr 20, 2023 · 17 revisions

JSCL HOW-TO

This page is not intent to be a comprehensive JSCL user documentation, nor a page of FAQ (since those Lisp wizards never ask, they just dig into the code and cast the spell).

This is a page for those non-wizard JSCL users to find some clues to do something, with extra links for them to find out more.

Please feel free to edit this page, add more examples or more questions.

Table of Contents

How to alert?

(#j:alert "this is an alert")
imagen

How to access JS object in JSCL?

With #j: and replace dot . with :, you can access almost everything.

To find out more:

https://github.com/jscl-project/jscl/wiki/JSCL-and-manipulations-with-JS-objects

https://github.com/jscl-project/jscl/wiki/FFI-Design-Discussions

#j:navigator:appVersion
imagen

how to access JSCL function in JS?

This might not be the best way, but this is the only method I know.

(defun hello () (#j:console:log "Hello, World!"))
(setf #j:hello #'hello)

imagen

How to add JSCL function to DOM event listener as callback?

I don't know, please edit this.

How to compile my Lisp file?

TODO

How to compile my Lisp file and expose functions/macros to the REPL?

TODO

Clone this wiki locally