From b3fa6d26d54352090d93aa2f84daaec76ca70dd9 Mon Sep 17 00:00:00 2001 From: Quentin Leonetti Date: Sun, 14 Jul 2019 06:12:06 +0200 Subject: [PATCH] add (str) --- desktop/sources/scripts/library.js | 4 ++++ examples/benchmark.lisp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index 8edb2c8..0fdfacc 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -221,6 +221,10 @@ function Library (ronin) { return arg } + this.str = (...args) => { + return args.reduce((acc, val) => { return acc + val }, '') + } + this.test = (name, a, b) => { if (Array.isArray(a)) { // TODO: make testing more solid diff --git a/examples/benchmark.lisp b/examples/benchmark.lisp index 75f3d77..478e06c 100644 --- a/examples/benchmark.lisp +++ b/examples/benchmark.lisp @@ -44,4 +44,8 @@ (def addOne (lambda (a) (add a 1))) (test "def - value" aaa 123) (test "def - func" (addOne 4) 5) + +; Generics + + (test "str" (str 1 4 "-" (add 3 4) ".jpg") "14-7.jpg") ) \ No newline at end of file