X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fffi.lisp;h=db6a23ec21bf0606797ce00194bced400f4f8a19;hb=030869df1e9829e0b284b96e585bdda7d45e0602;hp=da1ce274e4c11ca7a6485e0ba78076afba0b0bcc;hpb=c55bcd53c80b901559820b4c9fa23d8896ae3f5f;p=jscl.git diff --git a/src/ffi.lisp b/src/ffi.lisp index da1ce27..db6a23e 100644 --- a/src/ffi.lisp +++ b/src/ffi.lisp @@ -13,27 +13,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with JSCL. If not, see . -(defvar *js-package* - (make-package "JS")) - -(defun ffi-intern-hook (symbol) - (when (eq (symbol-package symbol) *js-package*) - (let ((sym-name (symbol-name symbol)) - (args (gensym))) - ;; Generate a trampoline to call the JS function - ;; properly. This trampoline is very inefficient, - ;; but it still works. Ideas to optimize this are - ;; provide a special lambda keyword - ;; cl::&rest-vector to avoid list argument - ;; consing, as well as allow inline declarations. - (fset symbol (eval `(%js-vref ,sym-name))) - ;; Define it as a symbol macro to access to the - ;; Javascript variable literally. - (%define-symbol-macro symbol `(%js-vref ,(string symbol)))))) - -(setq *intern-hook* #'ffi-intern-hook) - -(defvar *root* (%js-vref "window")) +(/debug "loading ffi.lisp!") (define-setf-expander oget (object key &rest keys) (let* ((keys (cons key keys))