-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass tests again for autogen, modules and mvs
- Loading branch information
Showing
74 changed files
with
720 additions
and
704 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(def a ["test" "toast"]) | ||
(print (copy a).[1]) | ||
let a = ["test", "toast"] | ||
print(copy(a).[1]) |
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,23 +1,21 @@ | ||
(defn hmm () | ||
(def {a} {1}) | ||
(defn capture () | ||
(+ a 1)) | ||
capture) | ||
fun hmm(): | ||
let a, _ = (1, 0) | ||
fun capture(): a + 1 | ||
capture | ||
|
||
(def _ {(copy (hmm))}) | ||
let _, _ = (copy(hmm), 0) | ||
|
||
(defn hmm-move () | ||
(def {a} {1}) | ||
fun hmm_move(): | ||
let a, _ = (1, 0) | ||
-- a is not explicitly copied, thus moved | ||
(defn capture () | ||
(+ a 1)) | ||
capture) | ||
fun capture(): a + 1 | ||
capture | ||
|
||
(def _ {(hmm-move)}) | ||
let _, _ = (copy(hmm_move), 0) | ||
|
||
(defn test () | ||
(def a ["hello"]) | ||
(fn :copy a () (print a.[0]))) | ||
fun test(): | ||
let a = ["hello"] | ||
fun () [a]: print(a.[0]) | ||
|
||
(def c (test)) | ||
((copy c)) | ||
let c = test() | ||
copy(c)() |
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,3 +1,3 @@ | ||
(def [a (array u8)] []) | ||
(def b& (copy a)) | ||
(array/push &b !'2') | ||
let a : array(u8) = [] | ||
let b& = copy(a) | ||
Array.push(&b, !'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,6 +1,7 @@ | ||
(def a ["aoeu"]) | ||
(def b& "aoeu") | ||
(string/modify-buf &b (fn (arr&) (__unsafe_ptr_set &(array/data arr) 1 !'i'))) | ||
(print b) | ||
(print "aoeu") | ||
(print a.[0]) | ||
let a = ["aoeu"] | ||
let b& = "aoeu" | ||
String.modify_buf(&b, fun(arr&): | ||
__unsafe_ptr_set(&Array.data(arr), 1, !'i')) | ||
print(b) | ||
print("aoeu") | ||
print(a.[0]) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
(print (fmt-str (copy "test ") 1)) | ||
print(fmt(copy("test "), 1)) |
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,5 +1,5 @@ | ||
(def a (#some {"thing"})) | ||
let a = Some(("thing", 0)) | ||
|
||
(match (copy a) | ||
((#some {t}) (print t)) | ||
(#none ())) | ||
match copy(a): | ||
Some((t, _)): print(t) | ||
None: () |
Oops, something went wrong.