~ubuntu-branches/ubuntu/trusty/librep/trusty

« back to all changes in this revision

Viewing changes to lisp/unscheme/syntax-funs.jl

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2001-11-13 15:06:22 UTC
  • Revision ID: james.westby@ubuntu.com-20011113150622-vgmgmk6srj3kldr3
Tags: upstream-0.15.2
ImportĀ upstreamĀ versionĀ 0.15.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#| syntax-funs.jl -- syntax expansion functions
 
2
 
 
3
   $Id: syntax-funs.jl,v 1.1 2000/07/29 10:46:09 john Exp $
 
4
 
 
5
   Copyright (C) 2000 John Harper <john@dcs.warwick.ac.uk>
 
6
 
 
7
   This file is part of librep.
 
8
 
 
9
   librep is free software; you can redistribute it and/or modify it
 
10
   under the terms of the GNU General Public License as published by
 
11
   the Free Software Foundation; either version 2, or (at your option)
 
12
   any later version.
 
13
 
 
14
   librep is distributed in the hope that it will be useful, but
 
15
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
   GNU General Public License for more details.
 
18
 
 
19
   You should have received a copy of the GNU General Public License
 
20
   along with Jade; see the file COPYING.  If not, write to
 
21
   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
|#
 
23
 
 
24
(define-structure unscheme.syntax-funs
 
25
 
 
26
    (export expand-lambda
 
27
            expand-if
 
28
            expand-set!
 
29
            expand-cond
 
30
            expand-case
 
31
            expand-and
 
32
            expand-or
 
33
            expand-let
 
34
            expand-let*
 
35
            expand-letrec
 
36
            expand-do
 
37
            expand-delay
 
38
            expand-define)
 
39
 
 
40
    ((open rep
 
41
           scheme.syntax-funs)
 
42
     (access unscheme.data))
 
43
 
 
44
;;; syntax
 
45
 
 
46
  (define (expand-if test consequent . alternative)
 
47
    (cond ((cdr alternative)
 
48
           (error "Scheme `if' only takes one else form"))
 
49
          (alternative
 
50
           `(\#cond (,test ,consequent)
 
51
                    ('t ,(car alternative))))
 
52
          (t `(\#cond (,test ,consequent))))))