Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Support for Fennel #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexjgriffith
Copy link

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.

This commit does not alter the functionality of lovebird if fennel is not present.

Introduced a new function lovebird.loadstringAlt. By default it points to the same function as lovebird.loadstring, but if fennel is not nil it points to  a new function described below. loadstringAlt is only used in the "index" page.

loadstringAlt

If fennel is not nil 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant