mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-20 13:48:48 +00:00
Fixed bug in sexp arity
This commit is contained in:
parent
dc38319a13
commit
99fdd176f4
6 changed files with 42 additions and 31 deletions
|
|
@ -130,7 +130,7 @@ module Builtin =
|
|||
| Value.Sexp (_, a) -> List.nth a i
|
||||
)
|
||||
)
|
||||
| ".length" -> (st, i, o, Some (Value.of_int (match List.hd args with Value.Array a -> List.length a | Value.String s -> String.length s)))
|
||||
| ".length" -> (st, i, o, Some (Value.of_int (match List.hd args with Value.Sexp (_, a) | Value.Array a -> List.length a | Value.String s -> String.length s)))
|
||||
| ".array" -> (st, i, o, Some (Value.of_array args))
|
||||
| ".stringval" -> let [a] = args in (st, i, o, Some (Value.of_string @@ Value.string_val a))
|
||||
| "isArray" -> let [a] = args in (st, i, o, Some (Value.of_int @@ match a with Value.Array _ -> 1 | _ -> 0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue