Remove the "any" type
This commit is contained in:
@ -10,7 +10,8 @@ function => dump
|
||||
true 0
|
||||
while
|
||||
{
|
||||
dup test.read req print
|
||||
// i
|
||||
dup test.read req intToStr req print
|
||||
1 + test.length dup < req
|
||||
}
|
||||
deq "" println
|
||||
|
@ -1,8 +1,8 @@
|
||||
//invalid,Function name print at 3:22 is already an intrinsic:END:
|
||||
|
||||
function int => print
|
||||
function str => print
|
||||
{
|
||||
deq
|
||||
}
|
||||
|
||||
42 print
|
||||
"42" print
|
||||
|
@ -1,8 +1,8 @@
|
||||
//invalid,Expected function name but got deq at 3:20:END:
|
||||
|
||||
function int => deq
|
||||
function str => deq
|
||||
{
|
||||
deq
|
||||
}
|
||||
|
||||
42 print
|
||||
"42" print
|
@ -1,8 +1,8 @@
|
||||
//invalid,Expected function name but got { at 4:2:END:
|
||||
|
||||
function int =>
|
||||
function str =>
|
||||
{
|
||||
deq
|
||||
}
|
||||
|
||||
42 print
|
||||
"42" print
|
||||
|
@ -14,4 +14,4 @@ function int int int int => int fibonacci
|
||||
}
|
||||
}
|
||||
|
||||
20 0 1 0 fibonacci println
|
||||
20 0 1 0 fibonacci intToStr println
|
@ -4,5 +4,5 @@
|
||||
|
||||
function int => int req_impl { }
|
||||
|
||||
1 2 3 req_impl print print println
|
||||
1 2 3 req print print println
|
||||
1 2 3 req_impl intToStr intToStr intToStr print print println
|
||||
1 2 3 req intToStr intToStr intToStr print print println
|
@ -5,9 +5,9 @@
|
||||
|
||||
|
||||
// Dequeues, enqueues 42 and 17, prints the head
|
||||
function any => int foo
|
||||
function int => int foo
|
||||
{
|
||||
deq 42 17 print
|
||||
deq 42 17 intToStr req print
|
||||
}
|
||||
|
||||
"test2" print false
|
||||
|
@ -1,9 +1,9 @@
|
||||
//valid,42footesttest2stuff
|
||||
//:END:
|
||||
|
||||
function int str any => str str str foo
|
||||
function int str str => str str str foo
|
||||
{
|
||||
print req deq "test" "test2" "stuff" print
|
||||
intToStr req req print req deq "test" "test2" "stuff" print
|
||||
}
|
||||
|
||||
42 "foo" "bar" foo print print println
|
@ -7,16 +7,29 @@ true while
|
||||
}
|
||||
|
||||
10 0 dup > req
|
||||
// true 10
|
||||
while
|
||||
{
|
||||
dup print
|
||||
|
||||
// i
|
||||
dup intToStr req print
|
||||
1 - 0 dup > req
|
||||
}
|
||||
deq
|
||||
|
||||
function bool => str boolToStr
|
||||
{
|
||||
if
|
||||
{
|
||||
"true"
|
||||
}
|
||||
else
|
||||
{
|
||||
"false"
|
||||
}
|
||||
}
|
||||
|
||||
true true true while
|
||||
{
|
||||
false
|
||||
}
|
||||
print println
|
||||
boolToStr boolToStr print println
|
Reference in New Issue
Block a user