packages feed

phino-0.0.166: test-resources/evaluate-packs/joins-a-side-that-raises-through-a-terminator.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The right side is a copy of 'throw', whose Ī» function 'L_throw' the entry
# names under 'terminators', the way EO raises its 'T' with a message. The
# side goes through the 'evaluate', 'stay', 'symbolize' and 'defer' lines
# untouched, so 'L_throw' is never fired and its message is never turned
# into a symbol. The join takes it for a side that raises, the way it takes
# ⊄: it keeps the left side, mints šœŽ3 to stand for the raise and names the
# copy of 'throw' in the comment of the 'joined' line (#2263).
symbolic: |
  - Ī»: L_fork
    terminators: [L_throw]
    dataize:
      š›æ1: $.on🌵
    morph:
      š‘›1: $.left🌵
      š‘›2: $.right🌵
    evaluate:
      š‘›3: š‘›1
      š‘›4: š‘›2
    stay:
      š‘›5: š‘›3
      š‘›6: š‘›4
    symbolize:
      š‘›7: š‘›5
      š‘›8: š‘›6
    defer:
      š‘›9: š‘›7
      š‘›10: š‘›8
    join:
      on: š›æ1
      left: š‘›9
      right: š‘›10
      otherwise: L_fork
location: 'Q.x'
input: '⟦ throw(message) ↦ ⟦ Ī» ā¤ L_throw ⟧, x ↦ ⟦ Ī» ā¤ L_fork, on🌵 ↦ ⟦ Ī» ā¤ šœŽ1 ⟧, left🌵 ↦ ⟦ k ↦ ⟦⟧, φ ↦ ⟦ Ī» ā¤ šœŽ2 ⟧ ⟧, right🌵 ↦ Φ.throw( "bad" ) ⟧.φ ⟧'
result: 'šœŽ4:Ī»'
protocol: |
  š•„(Φ.x):
    š”¼(L_fork):
      š”»(ξ.on🌵):
        š›æĀ·1Ā·1 := š”»(šœŽ1:Ī»)
      š›æ1Ā·1 := š›æĀ·1Ā·1  # š”»(ξ.on🌵)
      š•„(ξ.left🌵):
        morphed š‘›Ā·1Ā·1 := ⟦ k ↦ ⟦⟧, φ ↦ šœŽ2:Ī» ⟧
      š‘›1Ā·1 := š‘›Ā·1Ā·1  # š•„(ξ.left🌵)
      š•„(ξ.right🌵):
        remembered š‘›Ā·1Ā·2 ≔ Φ.throw  # ⟦ message ↦ āˆ…, Ī» ā¤ L_throw ⟧
        š‘›Ā·1Ā·3 := Φ.throw( message ↦ "bad" )
        š‘›Ā·1Ā·4 := ⟦ message ↦ "bad", Ī» ā¤ L_throw ⟧
        remembered š‘›Ā·1Ā·4 ≔ š‘›Ā·1Ā·2( message ↦ "bad" )
        morphed š‘›Ā·1Ā·5 := š‘›Ā·1Ā·4
      š‘›2Ā·1 := š‘›Ā·1Ā·4  # š•„(ξ.right🌵)
      joined šœŽ4 := š›æ1Ā·1 ? šœŽ2 : šœŽ3  # where šœŽ3 is ⊄ raised by š‘›Ā·1Ā·4
      š‘›Ā·1Ā·6 := ⟦ k ↦ ⟦⟧, φ ↦ šœŽ4:Ī» ⟧
      evaluated š‘›Ā·1Ā·7 := š‘›Ā·1Ā·6  # ⟦ Ī» ā¤ L_fork, on🌵 ↦ šœŽ1:Ī», left🌵 ↦ š‘›Ā·1Ā·1, right🌵 ↦ Φ.throw( "bad" ) ⟧
    normalized š‘›Ā·0Ā·1 := šœŽ4:Ī»  # š‘›Ā·1Ā·7.φ
    morphed š‘›Ā·0Ā·2 := š‘›Ā·0Ā·1