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

Support ! commands in REPL. #181

Merged
merged 1 commit into from
Nov 30, 2022
Merged

Support ! commands in REPL. #181

merged 1 commit into from
Nov 30, 2022

Conversation

porcuquine
Copy link
Collaborator

@porcuquine porcuquine commented Nov 30, 2022

When #180 introduced self-evaluating keyword symbols, the :load <filename> 'command' behavior in the REPL was broken.

This PR replaces that functionality by supporting the !(:load <filename>) syntax. It also makes all the other !(:command …) forms available at the REPL (not just when loading or running files).

This is a divergence from Lisp Lurk's REPL, which will probably not be updated to match the new (preferred) behavior.

@porcuquine porcuquine force-pushed the repl-commands branch 2 times, most recently from 1972145 to cfe63d6 Compare November 30, 2022 07:57
@porcuquine porcuquine marked this pull request as ready for review November 30, 2022 08:05
Copy link
Contributor

@weissjeffm weissjeffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the question below, looks good to me.

Is this a common-lisp 'ism? !(:foo bar) (where the meta function is invoked using a keyword like :foo instead of the usual symbol foo?)

If it is then I think it's ok to reuse as users would likely recognize what it means. If it isn't (and it's new syntax we're creating), we might want to consider using a symbol there instead. My rationale would be that we already know we're invoking the meta-language from the ! syntax, and we don't need further indication that the function isn't a lisp function.

You could argue that we want a completely separate namespace so that we can later mix calls to :foo and foo which are different things. However I don't know if that is the real intent (to be able to mix meta function calls with function calls).

@weissjeffm weissjeffm self-requested a review November 30, 2022 15:30
Copy link
Contributor

@weissjeffm weissjeffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment but it will not block approval.

@porcuquine
Copy link
Collaborator Author

I generally agree that these should eventually be normal symbols (perhaps in a namespace like .lurk.meta.). We might even want to lose the !(…), but there are issues to consider.

Regardless, this PR isn't intended to modify the syntax already used when loading and running Lurk files. It just extends the interactive REPL to use those same commands.

Once better package-handling is done, we can (strongly) consider this.

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.

2 participants