1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-23 03:37:40 +00:00

Use :length method for (length abstract)

Also adds the janet_lengthv API call. This is
needed because janet_length returns a 32 bit integer, where
as lengthv lets us return larger values (useful for typed arrays).

janet_mcall is an api function that should make it easier to call
a janet method from C code. It shares a similar signature with
janet_call.
This commit is contained in:
Calvin Rose
2019-09-08 15:36:21 -05:00
parent 4ebb749131
commit 39f1d81fd4
6 changed files with 95 additions and 11 deletions

View File

@@ -54,6 +54,7 @@
(assert (= (a 2) (b 1) ) "tarray views pointing same buffer")
(assert (= ((tarray/slice b) 3) (b 3) (a 6) 6) "tarray slice")
(assert (= ((tarray/slice b 1) 2) (b 3) (a 6) 6) "tarray slice")
(assert (= (:length a) (length a)) "length method and function")
(assert (= ((unmarshal (marshal b)) 3) (b 3)) "marshal")