freenode/#lisp - IRC Chatlog
Search
15:29:47
jmercouris
I'm trying to include parenscript in my program (which I distribute as a binary), I see the function (ps:ps-compile-stream), so I should be able to compile parenscript into javascript from some stream
15:30:13
jmercouris
Therefore, my question is, where, and how to save my parenscript such that I can load it using ps-compile-stream
15:31:52
eudoxia
you can use asdf:system-relative-pathname to get the absolute path of a file in your source tree
15:32:08
jmercouris
eudoxia: A good idea, but when I compile my program, I don't ship it with ASDF in the image
15:32:46
eudoxia
this would require building an ASDF extension, but I'm certain someone must've built one for parenscript
15:34:00
eudoxia
oh, apparently I have https://github.com/eudoxia0/asdf-linguist/blob/master/src/www/js.lisp#L20
15:34:03
jmercouris
eudoxia: It says here: http://quickdocs.org/asdf-linguist/ that you yourself have worked on this system
15:37:42
eudoxia
something like (defparameter +my-code+ `(progn ... parenscript code here ...)) and then use (ps:ps +my-code+)
15:39:24
jmercouris
I was about to suggest making a macro that automatically compiles parenscript inline and wraps them in defaparams
15:40:21
jmercouris
so we're looking at something like (defparameter ps-function-1 (ps:ps <ps code>))
15:41:29
jmercouris
Maybe at some latter point, if it ever actually matters, I'll make a robust way to load resources from my executable regardless of platform
15:42:06
jmercouris
I can create resources robustly, and access those created ones, what I cannot do is robustly ship resources (e.g. including parenscript file with my sources)
16:09:44
mfiano
jmercouris: the path to the asdf system may be different on a user's machine from the path when it was compiled. i have a hacky solution to that problem