2

I've been working to learn Parenscript, but I'm finding that the tutorial is more of a how-to for running a web server.

Does there already exist, or is it possible to create, a REPL so that I can see the actual javascript that is output when calling Parenscript methods?

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
lispquestions
  • 431
  • 3
  • 12
  • 2
    Have you explored the [SLIME integration](https://common-lisp.net/project/parenscript/reference.html#section-slime-integration) section of the manual? –  Jan 09 '20 at 10:20
  • 2
    Writing `(ps …)` forms at the usual REPL doesn't suit you? They output JavaScript. (+1 for a PS REPL though) – Ehvince Jan 09 '20 at 14:42

1 Answers1

1

There is the obvious:

(loop (print (ps:ps* (read))))

But I prefer having a form that I can edit in a buffer and just macroexpand-1 (C-c ret on the opening paren):

(defmacro js-func (name &body body)
  (let ((code (ps* `(progn ,@body))))
    `(defun ,name ()
       ,code))))
pjstirling
  • 191
  • 4