Emulating GOTO in Scheme with continuations

GOTO sucks and is evil and I hate it, but what if there were parentheses? `call/cc` is kinda like goto, so let’s use it to make goto.

terezi.pyrope.net

@screwlisp

Coincidentally, I assume, Abhijit Rao posted on LinkedIn earlier today a very interesting blurb, reporting on his use of this condition handling structure in conjunction with LLMs.

(Works for me in an incognito window, but you may not be able to see past the first comment if you don't have a LinkedIn account.)

https://www.linkedin.com/posts/quasiabhi_commonlisp-lisp-agents-activity-7425847332560293888-fYf9

The blurb references this more detailed account of the work, which I haven't been through in detail yet:

https://quasilabs.in/blog/2026/02/07/conditions-restarts-and-the-agent-that-chooses/

#CommonLisp #Lisp #ConditionHandling #Errors #Restarts #Continuations #ErrorHandling #ConditionHandling #LLM #LLMs #AI #Modularity #QuasiLabs #Reflection #Introspection #MetaProgramming

#commonlisp #lisp #agents #llm #programming #code #quasilabs | Abhijit Rao

In 1988 The Common Lisp Condition System was formally introduced by the X3J13 committee, responsible for the ANSI standard. It was a radical idea: The code that /detects/ an error should not decide how to /recover/ from it. Instead, the signaler establishes named recovery options—restarts—and lets a handler higher up the stack choose which one to invoke. The decision belongs to whoever has the broader context. This was ahead of its time. For 35+ years, the "broader context" was either a human in the debugger or a programmer who knew at compile time which restart to pick. Both worked fine. Then LLMs showed up. An agent monitoring a data pipeline encounters a validation error. Three restarts available. No hardcoded strategy. The agent needs to reason about system goals, weigh tradeoffs, adapt to context it wasn't explicitly programmed for. The architecture was already right. What was missing: semantic context for the handler. Restarts come with names and descriptions. Agents need to know what the system is /trying to achieve/. What failed and why. What each recovery option costs. Why these specific restarts exist in the first place. When you add structured intent metadata—goals, failure modes, design rationale—the agent can map recovery options to system objectives. Same restarts. Profoundly different decision-making surface. I built Telos to capture this. It makes the why behind code queryable at runtime. Combined with conditions and restarts, you get agent-legible error recovery. The condition/restart protocol already separates mechanism from policy. It supports multiple recovery options without the signaler knowing which will be chosen. It allows the handler to be arbitrarily far—in code, in time, in understanding—from the signaler. It's an architecture perfect for agentic systems. And, yes, Common Lisp has an ANSI standard. Blog post with full working CSV validator example: https://lnkd.in/dSbuDK6J #commonlisp #lisp #agents #llm #programming #code #quasilabs

Control structures in programming languages

Xavier Leroy

Control structures in programming languages: from goto to algebraic effects
Delimited continuations in lone lisp

The lone lisp delimited continuations implementation journey.

The review of an #esoteric tome on #continuations blunders on like an over-caffeinated grad student's fever dream 💤💻. The author can't decide if it's groundbreaking or a $100 paperweight 📚❓. Spoiler: it has no exercises - because who needs practice when you've got #theoretical #ramblings, right? 🤷‍♂️
https://swatson555.github.io/posts/2025-09-16-compiling-with-continuations.html #literature #HackerNews #gradstudent #HackerNews #ngated
Compiling with Continuations

A review of the book Compiling with Continuations, Appel (1992).

Compiling with Continuations

A review of the book Compiling with Continuations, Appel (1992).

🌘 持續性編譯:一本引導學習 Standard ML 與 continuations 的書籍評論
➤ 深入剖析 Appel《Continuations 編譯》的學習與實踐
https://swatson555.github.io/posts/2025-09-16-compiling-with-continuations.html
作者回顧了 Appel 於 1992 年出版的《Continuations 編譯》(Compiling with Continuations),並分享了實際編譯 MiniML 語言的經驗。該書雖未提供練習題,但其深入探討 Standard ML 的細節與 continuations 的實際應用,對有志於編譯器研究者仍有極大價值。作者實際操作時,利用 lex 和 yacc 工具鏈處理 MiniML 的詞法分析與語法解析,將程式碼轉換為 CPS 語言進行求值與最佳化。文章詳細闡述了從 MiniML 到 Lambda 再到 CPS 語言的轉換過程,並探討了閉包轉換、
#軟體工程 #編譯器 #程式語言理論 #Standard ML #continuations
Compiling with Continuations

A review of the book Compiling with Continuations, Appel (1992).

Вызовы функций, стек, куча и продолжения. Часть 2

В первой части статьи мы рассмотрели общую семантику применения функции в различных языках программирования и реализацию императивного вызова функции в машинном коде в стековом и бесстековом вариантах. Теперь мы рассмотрим теорию и практику реализации императивного вызова функции в модели продолжений (continuations): что такое продолжения, зачем нужны явные и неявные продолжения, как при помощи продолжений реализовать различные используемые в языках программирования управляющие конструкции.

https://habr.com/ru/articles/897812/

#стек #продолжения #continuations #Scheme #управляющие_конструкции

Вызовы функций, стек, куча и продолжения. Часть 2

В первой части статьи мы рассмотрели общую семантику применения функции в различных языках программирования и реализацию императивного вызова функции в машинном коде в стековом и бесстековом...

Хабр
Functional Tests As A Tree Of Continuations – Evan Miller

Just been thinking about a function that employs the tenth commandment from The Little Schemer: "Build functions to collect more than one value at
a time.". Found a catchy phrase for it: "Wrap it till you make it."

#scheme #programming #thelittleschemer #continuations