builtin functions partial fix

This commit is contained in:
ProgramSnail 2023-05-21 14:58:18 +03:00
parent bad48a1da0
commit e6a03ef9bf
7 changed files with 80 additions and 91 deletions

Binary file not shown.

View file

@ -1,9 +1,9 @@
// basic Float
// basic Int
// basic String
// basic Char
// basic Bool
// basic Unit
basic (Float : #Ord)
basic (Int : #Ord)
basic (String : #Ord)
basic (Char : #Ord)
basic (Bool : #Ord)
basic Unit
//
@ -76,11 +76,11 @@ namespace var Ord {
//
// typeclass Print =
// & var print : -> String
//
// typeclass Read =
// & var read : String -> Read
typeclass Show =
& var show : -> String
typeclass Read =
& var read : String -> Read
typeclass Debug =
& debug : -> String
@ -123,16 +123,16 @@ typeclass Enum =
//
decl ( -- ) : Int -> Int -> Int_0
// def ( -- ) : begin end = {
// var current = begin
// return (while current < end do {
// ; current += 1
// return current - 1
// })
// }
def ( -- ) : begin end = {
var current = begin
return (while current < end do {
; current += 1
return current - 1
})
}
decl print : String -> Unit
decl read : -> String
decl scan : -> String
decl func : String -> Int
def func : s = {
@ -143,7 +143,7 @@ def func : s = {
exec main {
for i in (,0 ,1 ,2 ,3) do func: "abacaba"
; print: ({
if true then bring read: else { ; print: "aaa" }
if true then bring scan: else { ; print: "aaa" }
bring "nothing"
; print: "aaa"
})