stk/Lib/match.stk

47 lines
1.5 KiB
Plaintext
Raw Normal View History

1998-04-10 06:59:06 -04:00
;;;;
;;;; m a t c h . s t k -- The bigloo match-case and match-lambda
;;;;
1999-09-05 07:16:41 -04:00
;;;; Copyright <20> 1997-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
1998-04-10 06:59:06 -04:00
;;;;
1999-09-05 07:16:41 -04:00
;;;; Permission to use, copy, modify, distribute,and license this
;;;; software and its documentation for any purpose is hereby granted,
;;;; provided that existing copyright notices are retained in all
;;;; copies and that this notice is included verbatim in any
;;;; distributions. No written agreement, license, or royalty fee is
;;;; required for any of the authorized uses.
;;;; This software is provided ``AS IS'' without express or implied
;;;; warranty.
1998-04-10 06:59:06 -04:00
;;;;
;;;; Author: Erick Gallesio [eg@kaolin.unice.fr]
;;;; Creation date: 28-Oct-1997 20:47
1999-09-05 07:16:41 -04:00
;;;; Last file update: 3-Sep-1999 19:53 (eg)
1998-04-10 06:59:06 -04:00
;;;;
;;;; This file implements code for loading the MATCH-CASE and MATCH-LAMBDA
;;;; of the Bigloo system. Bigloo files are unmodified and could be probably
;;;; adapted for STk (in particular, the code can deal with structures, and
;;;; a useful adaptation could be to manage objects instead).
(require "bigloo")
;;;;
;;;; WARNING: Order is important
;;;;
(load "Match/s2cfun.scm")
(load "Match/normalize")
(load "Match/descr.scm")
(load "Match/compiler.scm")
(load "Match/mexpand.scm")
1998-04-30 07:04:33 -04:00
(with-module STk
1998-04-10 06:59:06 -04:00
(import __match_expand)
(define-macro (match-lambda . clauses)
(expand-match-lambda (cons '() clauses)))
(define-macro (match-case expr . clauses)
`((match-lambda ,@clauses) ,expr)))
(provide "match")