lovebird
lovebird copied to clipboard
Provide Support for Fennel
Changes
Introduced a new function lovebird.loadstringAlt
.
By default it points to the same function as lovebird.loadstring
. If fennel
is in the global namespace it points to a new function described below.
lovebird.loadstringAlt
is only used for the "index" page. It is always called within an xpcall
.
Impact
If fennel
is not present in the global name space, the functionality of lovebird does not change.
If fennel
is present, then it can be used directly in the browser console.
I recommend a minor version bump. This does not break backwards compatibility.
loadstringAlt
If fennel is not nil (i.e., in the global space), opt to use fennel.compile-string
and loadstring
in place of raw loadstring
If fennel is not nil, always print the result using fennel.view
.