Add Result type for consistent error propagation #59
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#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
Adopt a consistent
Resulttype (Ok/Err) for error propagation throughout the evaluator, inspired by the seq-lisp-2 experiment.Motivation
Currently seq-lisp uses a mix of approaches for error handling:
#freturnsseq-lisp-2 demonstrated a clean
Resultunion type (Ok/Err) threaded through the entire evaluator, making error propagation explicit and consistent. Every operation that can fail returns aResult.Scope
Resultunion type insrc/types.seqor equivalentResultthrough evaluator dispatch insrc/eval.seqResulttry/catch mechanism works with the new typeNotes
This is the most invasive change of the seq-lisp-2 back-ports — it touches nearly every function in the Seq-level evaluator. Should be planned carefully and possibly done incrementally.
Inspired by
seq-lisp-2/src/types.seqandseq-lisp-2/src/eval.seq.