performs_itself

Function performs_itself 

Source
pub fn performs_itself(d: &Def, atom: &Effect) -> bool
Expand description

Does a definition perform an atom, as opposed to inheriting it from something it calls?

This distinction is the whole difference between a stub that works and one that deletes the program. An effect row propagates: validate calls charge, so validate’s row contains net.out(payments.example.com) too. Stubbing every definition whose row mentions the atom would replace validate itself — and §21.2’s claim that when “goes through the real validate, so authorisation is exercised rather than bypassed” would be false of every program that talks to anything.

A definition performs an atom itself when it declares it (§3.6’s uses clause is the published bound and the only way to introduce a non-primitive effect) or when its own body applies a primitive that carries it. Everything else in the row arrived from a callee, and the callee is where the stub belongs.