Commit | Line | Data |
---|---|---|
344927c3 DK |
1 | ;;; Guile Emac Lisp |
2 | ||
3 | ;; Copyright (C) 2001 Free Software Foundation, Inc. | |
4 | ||
5 | ;; This program is free software; you can redistribute it and/or modify | |
6 | ;; it under the terms of the GNU General Public License as published by | |
7 | ;; the Free Software Foundation; either version 2, or (at your option) | |
8 | ;; any later version. | |
9 | ;; | |
10 | ;; This program is distributed in the hope that it will be useful, | |
11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | ;; GNU General Public License for more details. | |
14 | ;; | |
15 | ;; You should have received a copy of the GNU General Public License | |
16 | ;; along with this program; see the file COPYING. If not, write to | |
17 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | ;; Boston, MA 02111-1307, USA. | |
19 | ||
20 | ;;; Code: | |
21 | ||
22 | (define-module (language elisp runtime) | |
1e018f6c DK |
23 | #:export (void nil-value t-value elisp-bool) |
24 | #:export-syntax (built-in-func)) | |
344927c3 DK |
25 | |
26 | ; This module provides runtime support for the Elisp front-end. | |
27 | ||
1e018f6c | 28 | |
344927c3 | 29 | ; The reserved value to mean (when eq?) void. |
1e018f6c | 30 | |
344927c3 | 31 | (define void (list 42)) |
1e018f6c DK |
32 | |
33 | ||
34 | ; Values for t and nil. | |
35 | ||
36 | ; FIXME: Use real nil. | |
37 | (define nil-value #f) | |
38 | (define t-value #t) | |
39 | ||
40 | ||
41 | ; Convert a scheme boolean to Elisp. | |
42 | ||
43 | (define (elisp-bool b) | |
44 | (if b | |
45 | t-value | |
46 | nil-value)) | |
47 | ||
48 | ||
49 | ; Define a predefined function; convenient macro for this task. | |
50 | ||
51 | (define-macro (built-in-func name value) | |
52 | `(begin | |
53 | (define-public ,name (make-fluid)) | |
54 | (fluid-set! ,name ,value))) |