mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Fixed performance/Sort.lama
This commit is contained in:
parent
1a1c2e6280
commit
80b391aff1
4 changed files with 6 additions and 4 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
fun compare (x, y) {
|
||||||
|
x - y
|
||||||
|
}
|
||||||
|
|
||||||
fun bubbleSort (l) {
|
fun bubbleSort (l) {
|
||||||
fun inner (l) {
|
fun inner (l) {
|
||||||
case l of
|
case l of
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
let version = "Version 1.10, 79460b744, Tue Sep 13 09:20:45 2022 +0300"
|
let version = "Version 1.10, 1a1c2e628, Tue Oct 11 17:05:26 2022 +0300"
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,6 @@ fun createMatcher (buf, pos, line, col) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun matchString (s) {
|
fun matchString (s) {
|
||||||
|
|
||||||
|
|
||||||
fun min (x, y) {
|
fun min (x, y) {
|
||||||
if x < y then x else y fi
|
if x < y then x else y fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,6 @@ infixr || after |> (l, r) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var expr = lid @ fun (s) {Lid (s)} || const @ fun (s) {Dec (s)},
|
var expr = lid @ fun (s) {Lid (s)} || const @ fun (s) {Dec (s)},
|
||||||
assn = lid |> fun (id) {token (":=") |> fun (s) {expr @ fun (e) {Assn (id, e)}}};
|
assn = lid |> fun (id) {token (":=") |> fun (s) {expr @ fun (e) {Assn (id, e)}}};
|
||||||
|
|
||||||
printf ("%s\n", case assn (initMatcher ("x:=3")) of Fail (err) -> err | Succ (s, _) -> s.string esac)
|
printf ("%s\n", case assn (initMatcher ("x:=3")) of Fail (err) -> err | Succ (s, _) -> s.string esac)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue