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:Ξ»