freenode/lisp - IRC Chatlog
Search
22:52:54
kagevf
right ... I think your solutions are better and more concise ... but if I didn't have those I think symbol-to-js-string is what I would try to use in my ignorance
22:53:47
kagevf
so is it better to think of it has an actual string in JS as opposed to the sting that's output by ps?
22:59:20
jasom
ps transforms s-expressions into strings. A string (which is what symbol-to-js-string) in the s-expression will always output a string in javascript.
23:03:18
kagevf
"SYMBOL-TO-JS-STRING is the Parenscript function responsible for translating Common Lisp symbols to JavaScript identifiers" <-- that part in the reference is a little confusing, in light of what's been demonstrated here today
23:03:24
jasom
e.g. if your json library makes a hash-table you can (gethash (ps:symbol-to-js-string 'foo-bar) ...) to use the same identifiers in your PS as when you get from JSON
23:04:14
kagevf
a-ha! that example you just gave reconciles that part in the reference with the actual usage
23:04:15
jasom
Right below that is the intended use: "It is helpful for writing libraries or other pieces of code that will interface with Parenscript-generated JavaScript."
23:04:47
jasom
so if you run ps on the frontend and get js on the backend, your backend will use symbol-to-js-string
23:07:30
kagevf
using parenscript on the backend? on the backend I would just use regular CL and something like cl-json, right? the hashtable example you wrote makes a lot of sense though ...
23:11:19
kagevf
ok ... I think by "backend" you mean generating the parenscript that will handle the json on the server/backend, for use on the frontend ... did I understand that right?
0:55:43
fiddlerwoaroof
kagevf: it would be sort of funny to build a workflow around parenscript and babel to avoid having to write Javascript directly
0:56:17
fiddlerwoaroof
parenscript to generate the JS, babel for round-tripping it back to parenscript and, maybe, for cleaning up identifiers
1:02:26
kagevf
yeah, I'm not following at all how / why you would use parenscript on the server other than to generate JS as part of the output of a page so it can be used / run on the frontend
1:07:58
fiddlerwoaroof
But, I think "normally" you'd either compile to js files and serve them statically, or you'd compile to JS and serve it up with something like hunchentoot
1:42:50
Josh_2
Currently I am representing lisp objects as javascript in my JS source code so that they can be referenced by other bits of JS code, no runtime overhead doing object lookups in js etc. Thanks jasom
8:04:19
shka_
contains definition for system "cl-ppcre-test". Please only define "cl-ppcre" and secondary systems with a name starting with "cl-ppcre/" (e.g. "cl-ppcre/test") in that file
8:58:10
splittist
That's an asdf warning. At some point it became fussy about, as it says, defsystems in the same file. So you would define (defsystem #:trivial-example (...)) and (defsystem #:trivial-example/tests (...)) But perhaps you meant something else.