From f856e7bb2a359a419953bb62495847a3a8ad93fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sat, 4 May 2013 03:38:07 +0100 Subject: [PATCH] More progresses in FFI --- src/compiler.lisp | 8 -------- src/ffi.lisp | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 53ec318..c61e931 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1611,14 +1611,6 @@ ;;; Javascript FFI -;; Receives the JS function as first argument as a literal string. The -;; second argument is compiled and should evaluate to a vector of -;; values to apply to the the function. The result returned. No type -;; conversion is done here. It is supposed to happen in the -;; trampoline. -(define-builtin %js-call (fun args) - (code fun ".apply(this, " args "))")) - (define-compilation %js-vref (var) (code "js_to_lisp(" var ")")) diff --git a/src/ffi.lisp b/src/ffi.lisp index 24fc472..6dd8418 100644 --- a/src/ffi.lisp +++ b/src/ffi.lisp @@ -28,7 +28,7 @@ ;; consing, as well as allow inline declarations. (fset symbol (eval `(lambda (&rest ,args) - (%js-call (%js-vref ,sym-name) (list-to-vector ,args))))) + (apply (%js-vref ,sym-name) ,args)))) ;; Define it as a symbol macro to access to the ;; Javascript variable literally. (%define-symbol-macro symbol `(%js-vref ,(string symbol)))))) -- 1.7.10.4