migration to seq 6.x #75
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
seq-lisp-2-backport
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/seq-lisp!75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "seq-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code Review: migration to seq 6.x
Overall this is a well-executed, large-scale mechanical migration. The transformations are consistent, the design doc is clear, and the scope is appropriately constrained.
What is done well
docs/design/seq-6.0-if-combinator-migration.mdclearly states the two transformation rules, out-of-scope items, and checkpoints. TheFOLLOWUP:pattern for deferring future refactors is a good discipline.cond if A else B thentocond [ A ] [ B ] ifandcond if A thentocond [ A ] whentransformations look correctly applied throughout all 11 files.unless. Theemit-tokenrewrite intokenizer.seqcorrectly usesunlesswhere the original had an empty true-branch, which is more idiomatic than[ ] [ work ] if.Minor observations
1.
include std:controlplacement (src/sexpr.seq)Only
sexpr.seqaddsinclude std:control. This works ifsexpr.seqis transitively included by every file that now useswhen/unless/combinatorif. Worth confirming the include chain is complete. If any file pulls in a different root module that omitsstd:control, a build failure could appear on specific paths.2. Removed comment in
emit-tokenThe original code had a meaningful comment in the empty true-branch; the
] unlessform dropped it. Sinceunlessis a logical inversion (quotation executes when condition is false), a brief comment helps readers unfamiliar with the combinator. Something likeNo-op if token empty; otherwise emitbefore the[would restore the context.3. Empty true-branch in
tokenize-loopThe
[ ]empty quotation for the base case is correct.Stateis already on the stack when done; no additional work needed. This matches the design doc pattern for divergent recursive base cases.4. Dispatch chain style
The multi-level chains use
] [ dup X string.equal? [inlined on the same line throughouteval.seq, consistently. Restructuring is explicitly out of scope for this PR, so fine as-is.Spot-check correctness
int-abs:dup 0 i.< [ 0 swap i.subtract ] when-- correct one-armed formmin:2dup i.> [ nip ] [ drop ] if-- correct two-armed formtrev-loopbase case via[ drop ]in the true branch -- correctformat-eval-errornested closing] if # Close guard if-else-- nesting aligns correctlyCI
Tests are in progress at review time. The key behavioral risk is TCO: recursive tail calls inside quotations need
musttaillowering under seqc 6.1.0. The design doc says this was verified with patch-seq, but the 10k-depth countdown smoke test (checkpoint 4) is the definitive confirmation.Summary
Clean, well-scoped migration. Actionable items: (1) confirm
include std:controltransitive coverage across all migrated files, and (2) optionally restore a comment on theemit-tokenunlessline. Everything else is a nit. Good work keeping the diff purely syntactic.