comparison lisp/ilisp/ilisp-val.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children b82b59fe008d
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 ;;; -*- Mode: Emacs-Lisp -*-
2
3 ;;; ilisp-val.el --
4
5 ;;; This file is part of ILISP.
6 ;;; Version: 5.7
7 ;;;
8 ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
9 ;;; 1993, 1994 Ivan Vasquez
10 ;;; 1994, 1995 Marco Antoniotti and Rick Busdiecker
11 ;;;
12 ;;; Other authors' names for which this Copyright notice also holds
13 ;;; may appear later in this file.
14 ;;;
15 ;;; Send mail to 'ilisp-request@lehman.com' to be included in the
16 ;;; ILISP mailing list. 'ilisp@lehman.com' is the general ILISP
17 ;;; mailing list were bugs and improvements are discussed.
18 ;;;
19 ;;; ILISP is freely redistributable under the terms found in the file
20 ;;; COPYING.
21
22
23
24 ;;;
25 ;;; ILISP buffer value interface
26 ;;;
27 ;;;
28
29 ;;;
30 (defun ilisp-value (variable &optional no-error-p)
31 "Return the value of VARIABLE in the ILISP buffer.
32 If NO-ERROR-P is NIL, then an error will be signalled if VARIABLE is nil."
33 (save-excursion
34 (set-buffer (ilisp-buffer))
35 (let ((value (eval variable)))
36 (if value
37 value
38 (if no-error-p
39 nil
40 (error "%s is not defined." variable))))))
41
42 ;;;
43 (defun set-ilisp-value (variable value)
44 "Set the value of VARIABLE in the ILISP buffer."
45 (save-excursion
46 (set-buffer (ilisp-buffer))
47 (set variable value)))