sig Foo(i as int) as int class X def main is shared X().run def run foos = List() foos.add(ref .sameValue) foos.add(ref .double) assert foos[0](5) == 5 def sameValue(i as int) as int return i def double(i as int) as int return i * 2