forked from boo-lang/boo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for calling precompiled methods which take a variable number …
…of arguments git-svn-id: https://svn.codehaus.org/boo/trunk@1728 2c1201b4-01cd-e047-a400-b836ae1fbc61
- Loading branch information
Showing
25 changed files
with
117 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
1, 2, 3 | ||
""" | ||
print(string.Format("{0}, {1}, {2}", ("1", 2, 3))) | ||
print(string.Format("{0}, {1}, {2}", "1", 2, 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import System | ||
|
||
a as (int, 2) = Array.CreateInstance(int, (2, 2)) | ||
a as (int, 2) = Array.CreateInstance(int, 2, 2) | ||
|
||
value = 0 | ||
for i in range(2): | ||
for j in range(2): | ||
a.SetValue(++value, (i, j)) | ||
assert value == a.GetValue((i, j)) | ||
a.SetValue(++value, i, j) | ||
assert value == a.GetValue(i, j) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import System | ||
|
||
def foo(): | ||
yield cast((int, 2), Array.CreateInstance(int, (2, 2))) | ||
yield cast((int, 2), Array.CreateInstance(int, 2, 2)) | ||
|
||
// test type inference | ||
for a in foo(): | ||
value = 0 | ||
for i in range(2): | ||
for j in range(2): | ||
a.SetValue(++value, (i, j)) | ||
assert value == a.GetValue((i, j)) | ||
a.SetValue(++value, i, j) | ||
assert value == a.GetValue(i, j) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
""" | ||
1 2 3 4 | ||
""" | ||
t = matrix(int, (2, 2)) | ||
t = matrix(int, 2, 2) | ||
|
||
t.SetValue(1, (0, 0)) | ||
t.SetValue(2, (0, 1)) | ||
t.SetValue(3, (1, 0)) | ||
t.SetValue(4, (1, 1)) | ||
t.SetValue(1, 0, 0) | ||
t.SetValue(2, 0, 1) | ||
t.SetValue(3, 1, 0) | ||
t.SetValue(4, 1, 1) | ||
|
||
print join(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
8 | ||
""" | ||
|
||
a = matrix(int, (5,2,4)) | ||
a = matrix(int, 5, 2, 4) | ||
|
||
a[0,0,0]=1 | ||
a[0,0,1]=2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
VarArgs.Method(1, 2) | ||
VarArgs.Method(System.Object[]) | ||
VarArgs.Method | ||
""" | ||
import BooCompiler.Tests | ||
|
||
d = VarArgs() | ||
d.Method(1, 2) | ||
d.Method((object(),)) | ||
d.Method() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
""" | ||
foo(*string) | ||
foo(*object) | ||
""" | ||
def foo(*args): | ||
print "foo(*object)" | ||
|
||
def foo(*args as (string)): | ||
print "foo(*string)" | ||
|
||
foo("foo", "bar") | ||
foo(("foo", "bar")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
2 | ||
3 | ||
""" | ||
m = matrix(int, (2, 2)) | ||
m = matrix(int, 2, 2) | ||
value = 0 | ||
for i in range(2): | ||
for j in range(2): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
""" | ||
21 | ||
""" | ||
m = matrix(int, (2, 2)) | ||
m = matrix(int, 2, 2) | ||
value = 0 | ||
for i in range(2): | ||
for j in range(2): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ b = 4, 5, 6 | |
c = 7, 8, 9 | ||
|
||
print join(cat(a, b)) | ||
print join(cat((a, b, c))) | ||
print join(cat(a, b, c)) |