etng-r2/delegation.tng
author Tony Garnock-Jones <tonygarnockjones@gmail.com>
Wed, 16 Jan 2019 17:15:58 +0000
changeset 438 1fe179d53161
parent 284 1bf8431909d4
permissions -rw-r--r--
Add missing primitive implementation for the plain interpreter.
define A = { .a -> do write("A"); .theAnswer; _ -> .other };

-- define B = rec { .a -> do write("IN"); do self.b; write("OUT") } |extends ({.b -> A.a} |extends A);
define B = rec { .a -> self.b; .b -> A.a } |extends A;

define debugTrace x -> rec {
  selector -> do write(selector);
	      do write("IN");
	      let result = self |as x selector;
	      do write(selector);
	      do write("OUT");
	      result
};