(Lispex)sicp.io
Lispex · SICP diagnostics · Run, read, repair

A useful error points back to the program you can change.

Run three representative failures, one guarded success, and one long successful computation through the Lispex SICP profile. Read the runtime status, typed profile error class, message, and bounded trace before editing the Scheme-compatible source into the behavior you intended.

Diagnostic question

Can you connect the reported class and message to one specific source assumption?

  • Distinguish an unbound name from a numeric error
  • Recognize a primitive domain mismatch
  • Use the trace to locate evaluated work before failure
  • Confirm that an unselected branch performs no work
  • Distinguish a completed evaluation from a truncated trace

The first program asks for a binding that its environment does not contain. The second reaches division with a zero divisor. The third supplies a number where car needs a pair-like object. These are different source assumptions and the Lispex SICP runtime reports different error classes.

The fourth program contains the same invalid division but selects the other if branch. It returns 7 because the invalid expression is not evaluated. Change one source fact at a time, run again, and use the new observation to decide whether the intended behavior is now present.

The fifth program counts down from 500 and completes with 0, but its trace reaches the 1,024-event bound and is truncated. Evaluation completion and trace completeness are separate observations.

Lispex · SICP sourceScheme-compatible SICP syntax executed by the Lispex SICP profile.
(+ missing 1)
Lispex learning runtimeLispex SICP profile 1.0.0
Loading Lispex SICP runtime
Lispex · SICP source13 / 1,048,576 UTF-8 bytes
Examples
Result
Output
Value
Diagnostic
Visible execution0 / 0 trace events
    This browser result is not a Lispex Vouch record or authority.wasm —
    Expected diagnostics

    The first three programs report unbound-variable with “unbound variable: missing”, numeric with “division by zero”, and wrong-type/domain with “car: expected an object”. The guarded program completes with 7 and no Lispex SICP profile error. The long program completes with 0 while its trace reports truncated at limit.

    What the trace can show

    The failing runs end with complete bounded traces after 3, 4, and 3 events. The guarded success has 3 events and no division application. The long success stores 1,024 events and reports a truncated trace. These observations describe only the shipped examples and do not prove every repair.

    Explain before revealing

    Five checks for reading diagnostics

    What is the smallest repair for the unbound name?

    Answer Define missing or replace it with a name that is already bound. The right choice depends on the intended program, not on making the error disappear by any means.

    What must change in the numeric failure?

    Answer The evaluated divisor must not be zero. A guard may be appropriate when zero is a valid input that needs separate behavior.

    What does the car diagnostic say about its input?

    Answer The evaluated argument is outside the primitive domain. Supplying a pair or choosing a primitive for numbers repairs different intended programs.

    Why is the guarded example not a hidden failure?

    Answer The evaluation rule for if visits only the selected branch, so the division expression performs no work in this run.

    Did a truncated trace make the long program fail?

    Answer No. The evaluator completed with 0. Only the educational trace stopped recording at its event bound, so later transitions are not visible.