Skip to content

Calling Lisp functions from generated JS? #429

Answered by davazp
aerique asked this question in Q&A
Discussion options

You must be logged in to vote

Your example works for me.

Just that your function uses a wrong syntax #j:console.log, it should be #j:console:log

https://jscl-project.github.io/

(defun printdelta (delta)
  (#j:console:log (format nil "delta=~S" delta)))

(#j:requestAnimationFrame #'printdelta)

Note that the REPL reads 1 form at at time. So you can't just copy-paste both. It'd be nice to fix this.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@aerique
Comment options

@hemml
Comment options

@aerique
Comment options

@aerique
Comment options

Comment options

You must be logged in to vote
2 replies
@davazp
Comment options

@aerique
Comment options

Answer selected by aerique
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants