print & read builtin functions, fixes. execution of programs partially works

This commit is contained in:
ProgramSnail 2023-05-20 00:01:54 +03:00
parent 27f643dfbc
commit 2556efcaba
16 changed files with 537 additions and 215 deletions

View file

@ -76,11 +76,11 @@ namespace var Ord {
//
typeclass Show =
& var show : -> String
typeclass Read =
& var read : String -> Read
// typeclass Print =
// & var print : -> String
//
// typeclass Read =
// & var read : String -> Read
typeclass Debug =
& debug : -> String
@ -132,6 +132,7 @@ decl ( -- ) : Int -> Int -> Int_0
// }
decl print : String -> Unit
decl read : -> String
decl func : String -> Int
def func : s = {
@ -140,5 +141,6 @@ def func : s = {
}
exec main {
for i in 0--10 do func: "abacaba"
for i in (,0 ,1 ,2 ,3) do func: "abacaba"
; print: ({ return read: })
}