view graal/com.oracle.truffle.sl.test/tests/FunctionLiteral.sl @ 13901:45f9dbb93988

modified Kind.format() to avoid calling any user code (JBS:GRAAL-14)
author Doug Simon <doug.simon@oracle.com>
date Thu, 06 Feb 2014 23:14:06 +0100
parents ff3136ecb5a7
children
line wrap: on
line source

function add(a, b) {
  return a + b;
}

function sub(a, b) {
  return a - b;
}

function foo(f) {
  println(f(40, 2));
}

function main() {
  foo(add);
  foo(sub);
}