╰─$ cat stg-programs/updatable-fn-calls.stg
define nu = {} \n {x, y, w, z} -> x {};
define main = {} \n {} -> let
x = {} \n {} -> One {};
y = {} \n {} -> Two {};
// closure to update
update = {x, y} \u {} -> nu {x, y, y, y};
// have something in argument stack
kickstart = {update} \n {a, b} -> update {};
// make sure this is never evaluated
bottom = {} \n {} -> bottom {}
in case (kickstart {bottom, bottom}) of
One {} -> Done {};
This was a program I tried, hoping that the "kickstart" function would ensure that there is something on the argument stack, so that when "nu" is entered, the rule would trigger. However, in my toy STG implementation here
(simplexhc link) (Raw:
https://github.com/bollu/simplexhc), the rule is not triggered. You can run it with:
I believe I have either misunderstood the rule or mis-implemented it. So if someone could point me to a reference of how to trigger the rule, I'd be very thankful.