1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-25 12:40:26 +02:00
guile/lang/elisp/internals/set.scm
Neil Jerram bbd26b5ae5 * Rename call-with-readline-completion-function' to with-readline-completion-function'.
* More tests for Elisp nil value.
* Development work on Elisp translator.
2002-01-30 00:03:40 +00:00

18 lines
607 B
Scheme

(define-module (lang elisp internals set)
#:use-module (lang elisp internals evaluation)
#:use-module (lang elisp internals signal)
#:export (set value))
;; Set SYM's variable value to VAL, and return VAL.
(define (set sym val)
(module-define! the-elisp-module sym val)
val)
;; Return SYM's variable value. If it has none, signal an error if
;; MUST-EXIST is true, just return #nil otherwise.
(define (value sym must-exist)
(if (module-defined? the-elisp-module sym)
(module-ref the-elisp-module sym)
(if must-exist
(error "Symbol's value as variable is void:" sym)
%nil)))