From b555a69d351b6be0ed61343d79a80771957a7413 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Mon, 17 Dec 2012 00:05:25 +0000 Subject: [PATCH] Funcall --- lispstrack.lisp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lispstrack.lisp b/lispstrack.lisp index 9395aec..8a78bf5 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -386,8 +386,6 @@ (define-compilation cdr (x) (concat "(" (ls-compile x env fenv) ").cdr")) - - (define-compilation symbol-name (x) (concat "(" (ls-compile x env fenv) ").name")) @@ -397,6 +395,16 @@ (define-compilation code-char (x) (concat "String.fromCharCode( " (ls-compile x env fenv) ")")) +(define-compilation funcall (func &rest args) + (concat "(" + (ls-compile func env fenv) + ")(" + (join (mapcar (lambda (x) + (ls-compile x env fenv)) + args) + ", ") + ")")) + (defun %compile-defvar (name) (push (make-var-binding name) *env*) (push (concat "var " (lookup-variable name *env*)) *toplevel-compilations*)) -- 1.7.10.4