Find Related products on Amazon

Shop on Amazon

Scheming a mise-en-abîme in BQN

Published on: 2025-06-26 11:53:30

Our goal is to adhere to the Revised\(^5\) Report on the Algorithmic Language Scheme (R5RS). However, seasoned schemers will quickly notice that our implementation still has quite some distance to cover in reaching full compliance. Let's start by defining some utilities. One aspect I don't like about Scheme is that it uses special values for Booleans, so we unfortunately need the 1-modifier. The function, on the other hand, is a fine example of the minimalistic OOP features BQN provides. It is used to create a class for the environment used in the Scheme interpreter. _bool ← {𝔽◶"#f"‿"#t"} C ← {𝕨𝕊p‿v: o‿h ⇐ 𝕨 ⋈ p •HashMap v F ⇐ {h.Has 𝕩 ? h; @≢o ? o.F 𝕩; 0} } We then define a global environment (instance of the C class) with the Scheme primitives of the target subset, expressed as BQN functions: env ← @ C ⟨ "sin", "cos", "tan", "asin", "acos", "atan" "log", "+", "-", "*", "/", ">", "<", ">=", "<=", "=" "abs", "append", "apply", "begin", "car", "cdr", "cons" "eq?", "expt", "equal?", ... Read full article.