From 3e62ce31499c237e604b4301af7b4d83cab410be Mon Sep 17 00:00:00 2001 From: Andrea Griffini Date: Sun, 5 May 2013 22:40:30 +0200 Subject: [PATCH] added afind primitive --- src/compiler.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler.lisp b/src/compiler.lisp index 8421b16..0f87ec3 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1598,6 +1598,12 @@ "if (i < 0 || i >= x.length) throw 'Out of range';" *newline* "return x[i] = " value ";" *newline*)) +(define-builtin afind (value array) + (js!selfcall + "var v = " value ";" *newline* + "var x = " array ";" *newline* + "return x.indexOf(v);" *newline*)) + (define-builtin get-internal-real-time () "(new Date()).getTime()") -- 1.7.10.4