view truffle/com.oracle.truffle.sl.test/tests/DefineFunction.sl @ 21951:9c8c0937da41

Moving all sources into truffle subdirectory
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 17 Jun 2015 10:58:08 +0200
parents graal/com.oracle.truffle.sl.test/tests/DefineFunction.sl@b16ec83edc73
children
line wrap: on
line source

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

function main() {
  defineFunction("function test(a, b) { return a + b; }");
  foo();

  defineFunction("function test(a, b) { return a - b; }");
  foo();
}