Commit 5ebfcd0d authored by Erick Gallesio's avatar Erick Gallesio

Infrastructure for Snow support

parent d6219879
......@@ -7431,7 +7431,7 @@ fi
ac_config_files="$ac_config_files Makefile src/Makefile src/extraconf.h doc/Makefile lib/Makefile gtklos/Makefile gtklos/gtklosconf.h utils/Makefile lib/boot-callcc.stk utils/stklos-config utils/stklos-script extensions/Makefile examples/Makefile examples/images/Makefile lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile lib/Lurc.d/Makefile tests/Makefile extensions/extconf.h doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1 doc/stklos-genlex.1 doc/stklos-install.1 doc/skb/stklos-version.stk"
ac_config_files="$ac_config_files Makefile src/Makefile src/extraconf.h doc/Makefile lib/Makefile gtklos/Makefile gtklos/gtklosconf.h utils/Makefile lib/boot-callcc.stk utils/stklos-config utils/stklos-script extensions/Makefile examples/Makefile examples/images/Makefile lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile lib/Lurc.d/Makefile lib/Snow.d/Makefile tests/Makefile extensions/extconf.h doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1 doc/stklos-genlex.1 doc/stklos-install.1 doc/skb/stklos-version.stk"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......@@ -8037,6 +8037,7 @@ do
"lib/SILex.d/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SILex.d/Makefile" ;;
"lib/Lalr.d/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Lalr.d/Makefile" ;;
"lib/Lurc.d/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Lurc.d/Makefile" ;;
"lib/Snow.d/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Snow.d/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"extensions/extconf.h") CONFIG_FILES="$CONFIG_FILES extensions/extconf.h" ;;
"doc/stklos.1") CONFIG_FILES="$CONFIG_FILES doc/stklos.1" ;;
......
......@@ -2,7 +2,7 @@ dnl configure.in for STklos
dnl
dnl Author: Erick Gallesio [eg@unice.fr]
dnl Creation date: 28-Dec-1999 21:19 (eg)
dnl Last file update: 20-Dec-2006 08:28 (eg)
dnl Last file update: 20-Dec-2006 10:10 (eg)
AC_INIT(src/stklos.c)
......@@ -514,6 +514,7 @@ AC_OUTPUT(Makefile src/Makefile src/extraconf.h doc/Makefile
extensions/Makefile examples/Makefile
examples/images/Makefile lib/Match.d/Makefile
lib/SILex.d/Makefile lib/Lalr.d/Makefile lib/Lurc.d/Makefile
lib/Snow.d/Makefile
tests/Makefile extensions/extconf.h
doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1
doc/stklos-genlex.1 doc/stklos-install.1
......
......@@ -2,9 +2,9 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 18-Dec-2006 21:30 (eg)
# Last file update: 20-Dec-2006 10:36 (eg)
SUBDIRS = Match.d SILex.d Lalr.d @LURCDIR@
SUBDIRS = Match.d SILex.d Lalr.d Snow.d @LURCDIR@
scheme_BOOT = assembler.stk \
bb.stk \
......@@ -77,6 +77,7 @@ scheme_OBJS = compfile.ostk \
lex-rt.ostk \
match.ostk \
pp.ostk \
snow-support.ostk \
srfi-1.ostk \
srfi-2.ostk \
srfi-4.ostk \
......
......@@ -18,7 +18,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 18-Dec-2006 21:30 (eg)
# Last file update: 20-Dec-2006 10:36 (eg)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
......@@ -197,7 +197,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = Match.d SILex.d Lalr.d @LURCDIR@
SUBDIRS = Match.d SILex.d Lalr.d Snow.d @LURCDIR@
scheme_BOOT = assembler.stk \
bb.stk \
bonus.stk \
......@@ -268,6 +268,7 @@ scheme_OBJS = compfile.ostk \
lex-rt.ostk \
match.ostk \
pp.ostk \
snow-support.ostk \
srfi-1.ostk \
srfi-2.ostk \
srfi-4.ostk \
......
# Makefile.am for STklos lib
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 20-Dec-2006 10:09 (eg)
# Last file update: 20-Dec-2006 10:43 (eg)
scheme_snowdir = $(prefix)/share/@PACKAGE@/@VERSION@/Snow.d
scheme_snow_DATA =
This diff is collapsed.
;;;;
;;;; srfi89.stk -- SRFI-89 -> STklos extended lambdas.
;;;;
;;;; Copyright 2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program 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, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 20-Dec-2006 10:21 (eg)
;;;; Last file update: 20-Dec-2006 10:34 (eg)
;;;;
;; Code derivated from Bigloo srfi89 support for Snow packages
;; Code given by Manuel Serrano
(define (srfi89->ext-lambda-proto args)
(define (srfi89-positional? a)
(match-case a
(((? symbol?) ?-) #t)
(else #f)))
(define (srfi89-named? a)
(match-case a
(((? keyword?) (? symbol?) ?-) #t)
(else #f)))
(define (srfi89-named->dsssl-named arg)
(match-case arg
((?key ?- ?val)
(list (string->symbol (keyword->string key)) val))))
(if (not (pair? args))
args
(let loop ((a args)
(reqs '())
(optionals '())
(names '()))
(cond
((symbol? a)
(if (or (pair? optionals) (pair? names))
(error "not implemented yet ~S" args)
args))
((null? a)
(if (and (null? optionals) (null? names))
args
(let ((opts (if (pair? optionals)
(cons '#!optional (reverse! optionals))
'()))
(names (if (pair? names)
(cons '#!key names)
'())))
(append (reverse! reqs) opts names))))
((not (pair? a))
(error "illegal argument ~S" a))
(else
(let ((a0 (car a)))
(cond
((symbol? a0)
(loop (cdr a) (cons a0 reqs) optionals names))
((srfi89-positional? a0)
(loop (cdr a) reqs (cons a0 optionals) names))
((srfi89-named? a0)
(let ((d (srfi89-named->dsssl-named a0)))
(loop (cdr a) reqs optionals (cons d names))))
(else
(error "illegal argument ~S" a)))))))))
;;;;
;;;; snow-support.stk -- Support Scheme Now! packages for STklos
;;;;
;;;; Copyright © 2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program 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, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 20-Dec-2006 10:18 (eg)
;;;; Last file update: 20-Dec-2006 10:42 (eg)
;;;;
(define-module SNOW
(include "Snow.d/snow-srfi89.stk")
(include "Snow.d/snow-exception.stk")
; (include "Snow.d/snow-record.stk")
; (include "Snow.d/snow-package.stk")
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment