diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index 0d0c012..a1fd99e 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -70,6 +70,10 @@ function Library (ronin) { return arr[0] } + this.last = (arr) => { + return arr[arr.length - 1] + } + this.rest = ([_, ...arr]) => { return arr } diff --git a/examples/benchmark.lisp b/examples/benchmark.lisp index 7a51145..f209af8 100644 --- a/examples/benchmark.lisp +++ b/examples/benchmark.lisp @@ -13,4 +13,14 @@ (test "mod" (mod 6 4) 2) (test "clamp" (clamp 12 4 8) 8) (test "step" (step 12 10) 10) + +; Logic + + (test "lt" (lt 3 4) true) + (test "gt" (gt 3 4) false) + +; Arrays + + (test "first" (first ("a" "b" "c")) "a") + (test "last" (last ("a" "b" "c")) "c") ) \ No newline at end of file