lovebird icon indicating copy to clipboard operation
lovebird copied to clipboard

Provide Support for Fennel

Open alexjgriffith opened this issue 3 years ago • 0 comments

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.

alexjgriffith avatar May 08 '21 07:05 alexjgriffith