1
0
forked from Mirror/wren

Allow multiple arguments to IO.print().

This commit is contained in:
Bob Nystrom
2014-04-09 07:48:35 -07:00
parent dfe65305c3
commit 7393e12555
14 changed files with 176 additions and 25 deletions

View File

@ -1,7 +1,7 @@
var f0 = new Fn { IO.print("zero") }
var f1 = new Fn {|a| IO.print("one " + a) }
var f2 = new Fn {|a, b| IO.print("two " + a + " " + b) }
var f3 = new Fn {|a, b, c| IO.print("three " + a + " " + b + " " + c) }
var f1 = new Fn {|a| IO.print("one ", a) }
var f2 = new Fn {|a, b| IO.print("two ", a, " ", b) }
var f3 = new Fn {|a, b, c| IO.print("three ", a, " ", b, " ", c) }
f0.call("a") // expect: zero
f0.call("a", "b") // expect: zero

View File

@ -1,2 +1,2 @@
var f2 = new Fn {|a, b| IO.print(a + b) }
var f2 = new Fn {|a, b| IO.print(a, b) }
f2.call("a") // expect runtime error: Function expects more arguments.