From 62c8c41796c1f2f385e7943b50234f41d43baa00 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Thu, 9 May 2013 09:44:40 -0400 Subject: [PATCH] Implement fboundp. --- src/boot.lisp | 4 +++- src/compiler.lisp | 5 ++++- src/toplevel.lisp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/boot.lisp b/src/boot.lisp index 44587f2..47f4309 100644 --- a/src/boot.lisp +++ b/src/boot.lisp @@ -92,6 +92,9 @@ (defun boundp (x) (boundp x)) +(defun fboundp (x) + (fboundp x)) + ;; Basic functions (defun = (x y) (= x y)) (defun * (x y) (* x y)) @@ -544,4 +547,3 @@ (defun error (fmt &rest args) (%throw (apply #'format nil fmt args))) - diff --git a/src/compiler.lisp b/src/compiler.lisp index 4a27413..be10266 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1,4 +1,4 @@ -;;; compiler.lisp --- +;;; compiler.lisp --- ;; copyright (C) 2012, 2013 David Vazquez ;; Copyright (C) 2012 Raimon Grau @@ -1390,6 +1390,9 @@ (define-builtin boundp (x) (js!bool (code "(" x ".value !== undefined)"))) +(define-builtin fboundp (x) + (js!bool (code "(" x ".fvalue !== undefined)"))) + (define-builtin symbol-value (x) (js!selfcall "var symbol = " x ";" *newline* diff --git a/src/toplevel.lisp b/src/toplevel.lisp index b5ef24b..544022f 100644 --- a/src/toplevel.lisp +++ b/src/toplevel.lisp @@ -60,7 +60,7 @@ defparameter defun defvar destructuring-bind digit-char digit-char-p disassemble do do* documentation dolist dotimes ecase eighth eq eql equal error eval every export expt fdefinition fifth find - find-package find-symbol first flet format fourth fset funcall + find-package find-symbol first flet format fourth fboundp fset funcall function functionp gensym get-internal-real-time get-setf-expansion get-universal-time go identity if in-package incf integerp intern intersection keywordp labels lambda last length let let* -- 1.7.10.4