You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old interpreter did this automatically whenever these objects passed between the two languages, which was a bad decision that lead to some hacks like:
; array lives in js land to avoid expensive conversion
(definesequence ((js "(arr)=>(type, a, b) => {\n""if (type === 'add') {\n"" arr.unshift(a); return;\n""}\n""if (type === 'dump') {a(true, arr); return;}\n""return arr.slice(""Math.max(0, arr.length - a - b), ""Math.max(0, arr.length - a));\n""}\n") nil))
Because of this, I made Scheme pairs and JS arrays pass to the other language with no conversion. JS arrays are readable in Scheme through code like (js-ref (js "[1, 2, 3]") "1"), but there's currently no good way to manipulate Scheme pairs from JS (due to dart2js making the properties unreadable).
There are two things I'd like to do:
Add list->js-array and js-array->list procedures, or possibly piggy-back off vectors (Add vectors #23)
Pass proxies to JS instead of the pairs themselves, to allow JS to access first and second directly.
The text was updated successfully, but these errors were encountered:
The old interpreter did this automatically whenever these objects passed between the two languages, which was a bad decision that lead to some hacks like:
Because of this, I made Scheme pairs and JS arrays pass to the other language with no conversion. JS arrays are readable in Scheme through code like
(js-ref (js "[1, 2, 3]") "1")
, but there's currently no good way to manipulate Scheme pairs from JS (due to dart2js making the properties unreadable).There are two things I'd like to do:
list->js-array
andjs-array->list
procedures, or possibly piggy-back off vectors (Add vectors #23)first
andsecond
directly.The text was updated successfully, but these errors were encountered: