Add session (Notebook Mode) support for Common Lisp via SBCL#450
Open
nelsonlove wants to merge 4 commits into
Open
Add session (Notebook Mode) support for Common Lisp via SBCL#450nelsonlove wants to merge 4 commits into
nelsonlove wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A ReplExecutor for lisp: a minimal prompt-less read-eval-print loop is passed via --eval, printing values one per line and returning to the loop on errors instead of invoking the interactive debugger. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sions Threads the running block's parsed args through executor.run so the session eval loop can select what a block reports: transcript (default, REPL-style), output (stdout only), or value (the last form's values, stdout discarded). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
Pushed a follow-up commit adding org-babel-style result modes for session blocks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #446 (Common Lisp via SBCL) — adds interactive/Notebook Mode support, so consecutive
lispblocks in a note share a persistent SBCL image: definitions and state carry over between blocks, like the existing js/python/R notebook modes (or org-babel's:session).Implementation
LispExecutorextendsReplExecutor. Instead of SBCL's own REPL (which prints*prompts to stdout and drops into the interactive debugger on error, hanging a piped session), a minimal read-eval-print loop is passed via--eval:~&~s~%)handler-casearound bothreadandeval), so one bad block doesn't kill the session*debugger-hook*fallback exits rather than hangs if anything escapes(values)so the loop prints nothing for itThe non-interactive
lispArgssetting (default--script) is intentionally not reused — it would prevent the session loop from running. A "Run Common Lisp blocks in Notebook Mode" toggle is added to the Lisp settings panel, wired to the existinglispInteractivesetting.Testing
npm run buildpasses(defun square (x) (* x x))in one block,(square 7)in the next →49; an(error "boom")block prints the condition and subsequent blocks still run in the same image🤖 Generated with Claude Code