packages feed

phino-0.0.161: 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🌡):
        𝑛·1Β·2 := Ξ¦.throw( message ↦ "bad" )
        𝑛·1Β·3 := ⟦ message ↦ "bad", Ξ» ‍ L_throw ⟧
        morphed 𝑛·1Β·4 := 𝑛·1Β·3
      𝑛2Β·1 := 𝑛·1Β·3  # 𝕄(ΞΎ.right🌡)
      joined 𝜎4 := 𝛿1Β·1 ? 𝜎2 : 𝜎3  # where 𝜎3 is βŠ₯ raised by 𝑛·1Β·3
      𝑛·1Β·5 := ⟦ k ↦ ⟦⟧, Ο† ↦ 𝜎4:Ξ» ⟧
    morphed 𝑛·0Β·1 := 𝜎4:Ξ»