Skip to content

Commit

Permalink
up to failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Jan 19, 2025
1 parent 2dc35ca commit b5b3a1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Chapters/09-EvaluatorPrimitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,11 @@ CInterpreter >> visitMethodNode: aMethodNode
^ self visitNode: aMethodNode body
```

With this our new test should pass.
Our new test pass.


### Primitive Failures and Fallback Code


Let's now consider what should happen when a primitive fails.
For example, following Pharo's specification, primitive 1 fails when the receiver or the argument are not small integers, or whenever their sum overflows and does not fit into a small integer anymore.

Expand All @@ -206,6 +205,8 @@ To produce one of such failing cases, we can implement primitive 1 in our `CInte

We define two methods `failingPrimitive` and `callingFailingPrimitive` to support the test of failing primitive.

Stef here.

```
CInterpretable >> failingPrimitive
<primitive: 1>
Expand Down

0 comments on commit b5b3a1c

Please sign in to comment.