phino-0.0.156: test-resources/evaluate-packs/remints-a-copy-of-an-object-of-the-world-as-a-deferred-symbol.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The tail of the pair below is a copy of 'Ξ¦.l/.throw', which raises, so firing
# it answers the copy as it is. A 'remint' step answers such a copy of an
# object of the world with a fresh symbol and writes it as a deferred copy,
# naming the object by the term as written and every argument by the symbol it
# comes to: here 'π2', the known symbol of the message '01-' (#1923).
symbolic: |
- Ξ»: L_shrink
morph:
π1: $.x
rewrite:
π2:
of: π1
rules:
- name: small-pair
pattern: β¦ !B1, head β¦ π1, tail β¦ π2, !B2 β§
result: β¦ !B1, head β¦ π3, tail β¦ π4, !B2 β§
where:
- meta: π3
function: remint
args: [π1]
- meta: π4
function: remint
args: [π2]
terminators: [L_throw]
π: π2
location: 'Q.y'
input: 'β¦ l/ β¦ β¦ throw(message) β¦ β¦ Ξ» β€ L_throw β§ β§, y β¦ β¦ x β¦ β¦ head β¦ β¦ Ξ» β€ π1 β§, tail β¦ Ξ¦.l/.throw( message β¦ β¦ Ξ β€ 01- β§ ) β§, Ξ» β€ L_shrink β§.tail β§'
result: 'π3:Ξ»'
protocol: |
π(Ξ¦.y):
πΌ(L_shrink):
π1Β·1 := β¦ head β¦ π1:Ξ», tail β¦ Ξ¦.l/.throw( message β¦ 01-:Ξ ) β§ # π(ΞΎ.x)
π(Ξ¦.l/.throw( message β¦ 01-:Ξ )):
πΒ·1Β·1 := β¦ message β¦ β
, Ξ» β€ L_throw β§( message β¦ 01-:Ξ )
π»(π2:Ξ») == 01-
deferred(π3) := Ξ¦.l/.throw( message β¦ π2:Ξ» ) # π(Ξ¦.l/.throw( message β¦ 01-:Ξ ))
π2Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π3:Ξ» β§ # π1
πΒ·1Β·2 := β¦ head β¦ π1:Ξ», tail β¦ π3:Ξ» β§ # π
πΒ·1Β·3 := β¦ head β¦ π1:Ξ», tail β¦ π3:Ξ» β§ # π(πΒ·1Β·2)