Skip to content

Commit

Permalink
Eu2C: Reorganise the syntax modules so that syntax-0 corresponds to l…
Browse files Browse the repository at this point in the history
…evel-0
  • Loading branch information
Henry authored and Henry committed Oct 6, 2010
1 parent 9120391 commit 5ad7206
Show file tree
Hide file tree
Showing 50 changed files with 103 additions and 154 deletions.
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-aux.em
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
c-string-interface))
syntax (tail
apply
syntax-0
syntax-i
setf)
export (reverse-list
test-range-indizes
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-convert.em
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
convert)
syntax (tail
apply
syntax-0
syntax-i
setf)
export (converter
convert))
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-generic.em
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(import (tail
standard-generic-function)
syntax (tail
syntax-0)
syntax-i)
export (accumulate
accumulate1
any?
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
c-string-interface))
syntax (tail
apply
syntax-0
syntax-i
setf)
export (primitive-setter-string-ref
primitive-string-size
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-list.em
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
collection-generic
collection-aux)
syntax (tail
syntax-0
syntax-i
setf)
export (accumulate
accumulate1
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-string.em
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
string-ref-u)
collection-i))
syntax (tail
syntax-0)
syntax-i)
export (accumulate
accumulate1
any?
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-table.em
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
collection-aux
table)
syntax (tail
syntax-0)
syntax-i)
export (<table>
make-table
setter-table-ref
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/collection-vector.em
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
collection-generic
collection-aux)
syntax (tail
syntax-0)
syntax-i)
export (accumulate
accumulate1
any?
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/compare.em
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
syntax (eulisp-kernel
(only (and
cond)
syntax-0))
syntax-i))
expose (compare-generic)
export (eq
eql
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/condition-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
basic-condition
condition-ii)
syntax (tail
syntax-0
syntax-i
condition-ii)
c-import (<stdlib.h>
<stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/double-float.em
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
c-import (<float.h>)
syntax (eulisp-kernel
(only (and)
syntax-0))
syntax-i))
export (<double-float>
double-float?
most-positive-double-float
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/eulisp-kernel.em
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(import (tail
function
standard-generic-function)
syntax (syntax-0
syntax (syntax-i
standard-generic-function)
expose (function
tail
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/event-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
timer))
syntax ((only (when
unless)
syntax-0))
syntax-i))
export (wait
get-timer
timeout-expired
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/int.em
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
compare-generic))
syntax (eulisp-kernel
(only (and)
syntax-0))
syntax-i))
export (binary+
binary-
binary/
Expand Down
4 changes: 2 additions & 2 deletions Eu2C/EuLispModules/level-0.em
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
stream
string
symbol
syntax-0
syntax-i
table
;;***HGW thread ; For thread support
vector)
Expand All @@ -73,7 +73,7 @@
stream
string
symbol
syntax-0
syntax-i
table
;;***HGW thread ; For thread support
vector))
Expand Down
6 changes: 3 additions & 3 deletions Eu2C/EuLispModules/level-0x.em
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
;;;-----------------------------------------------------------------------------
;;; Title: Level 0 of EuLisp extended for interaction with C
;;; Description:
;; This is intended as a basic system which provides level 0 of EuLisp and
;; some additional things needed for interaction with C
;; This is intended as a basic system which provides EuLisp level-0 and
;; some additional functionality needed for interaction with C.
;;; Authors: Ingo Mohr
;;; Maintainer: Henry G. Weller
;;;-----------------------------------------------------------------------------

(defmodule level-0x
(import (level-0)
syntax (level-0)
syntax (syntax-0)
expose (level-0
unix-interface
c-interface))
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/list.em
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
compare-generic))
syntax (tail
(only (and)
syntax-0))
syntax-i))
expose ((only (<null>
<cons>
<list>
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/object-0-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
tail
option-lists)
syntax (eulisp-kernel
syntax-0
syntax-i
tail)
export (<object>
make
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/option-lists.em
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
(only (cond
and
when)
syntax-0))
syntax-i))
export (find-option
get-option
check-options))
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/pair.em
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
eulisp-kernel))
syntax (tail
(only (cond)
syntax-0))
syntax-i))
export (atom?
cons?
copy-alist
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/small-table.em
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(defmodule small-table
(import (tail)
syntax (tail
syntax-0)
syntax-i)
export (<small-table>
make-small-table
small-table-ref
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/stream-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
syntax (tail
(only (when
unless)
syntax-0)
syntax-i)
condition-ii)
export (<stream>
<file-stream>
Expand Down
4 changes: 2 additions & 2 deletions Eu2C/EuLispModules/string.em
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

(defmodule string
(import (tail
syntax-0
syntax-i
string-ii
convert
symbol
Expand All @@ -50,7 +50,7 @@
shallow-copy)
copy))
syntax (tail
syntax-0)
syntax-i)
export (<string>
string?
make-string
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/symbol.em
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(only (sprintf-3)
c-stdio))
syntax (tail
syntax-0)
syntax-i)
export (<symbol>
symbol?
gensym
Expand Down
72 changes: 2 additions & 70 deletions Eu2C/EuLispModules/syntax-0.em
Original file line number Diff line number Diff line change
@@ -1,71 +1,3 @@
;;; Copyright 1994-2010 Fraunhofer ISST
;;; Copyright 2010 Henry G. Weller
;;;-----------------------------------------------------------------------------
;; This file is part of
;;; --- EuLisp System 'Eu2C'
;;;-----------------------------------------------------------------------------
;;
;; Eu2C is free software: you can redistribute it and/or modify it under the
;; terms of the GNU General Public License version 2 as published by the Free
;; Software Foundation.
;;
;; Eu2C is distributed in the hope that it will be useful, but WITHOUT ANY
;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.
;;
;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <http://www.gnu.org/licenses/>.
;;
;;;-----------------------------------------------------------------------------
;;; Title: Level-0 syntax
;;; Authors: Ingo Mohr
;;; Maintainer: Henry G. Weller
;;;-----------------------------------------------------------------------------

(defmodule syntax-0
(import (tail
basic-list
basic-syntax)
syntax (tail)
expose (basic-list
basic-compare
basic-syntax))

;;;-----------------------------------------------------------------------------
;;; cond
;;;-----------------------------------------------------------------------------
(defmacro cond clauses
(if (null? clauses) ()
(if (null? (cdr (car clauses))) `(or ,(car (car clauses))
(cond ,@(cdr clauses)))
(if (eq (car (car clauses)) 't) `(progn ,@(cdr (car clauses)))
`(if ,(car (car clauses))
(progn ,@(cdr (car clauses)))
(cond ,@(cdr clauses)))))))
(defmacro and forms
(if (null? forms) 't
(if (null? (cdr forms)) (car forms)
`(if ,(car forms)
(and ,@(cdr forms))
()))))

(defmacro when (cond . forms)
(if (null? forms) ()
`(if ,cond (progn ,@forms) () )))

(defmacro unless (cond . forms)
(if (null? forms) ()
`(if ,cond () (progn ,@forms) )))

(defmacro block (identifier . forms)
(if (null? forms) ()
`(let/cc ,identifier ,@forms)))

(defmacro return-from (identifier . form)
`(,identifier ,(if (null? form) () (car form))))

;;;-----------------------------------------------------------------------------
) ;; End of module syntax-0
;;;-----------------------------------------------------------------------------
(expose (syntax-i
object-0)))
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/table-aux.em
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(only (<character> convert-char-int character?)
character))
syntax (tail
syntax-0)
syntax-i)
export (mapc
hash
assoc
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/table.em
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
basic-list-0)
table-aux)
syntax (tail
syntax-0
syntax-i
setf)
export (<table>
table?
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/thread-i.em
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
tail))
syntax ((only (when
unless)
syntax-0))
syntax-i))
export (TL-empty
TL-single
TL-on-top
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/thread-ii.em
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
letcc))
syntax ((only (when
unless)
syntax-0))
syntax-i))
export (<thread>
thread?
make-thread
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/thread.em
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
syntax ((only (unless
when
cond)
syntax-0)
syntax-i)
(only (with-handler)
condition))
export (<thread>
Expand Down
2 changes: 1 addition & 1 deletion Eu2C/EuLispModules/vector.em
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(only (equal)
compare-generic))
syntax (tail
syntax-0)
syntax-i)
export (<vector>
vector?
vector-size
Expand Down
Loading

0 comments on commit 5ad7206

Please sign in to comment.