From: Chris Hanson Date: Fri, 19 Nov 2004 06:51:39 +0000 (+0000) Subject: Add syntax #!default and #!key. X-Git-Tag: 20090517-FFI~1466 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ea2ba7ad1815aa7390ef28ca876ae50774b65f8c;p=mit-scheme.git Add syntax #!default and #!key. --- diff --git a/v7/src/runtime/parse.scm b/v7/src/runtime/parse.scm index b23af2de9..7276898e3 100644 --- a/v7/src/runtime/parse.scm +++ b/v7/src/runtime/parse.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: parse.scm,v 14.52 2004/11/04 03:01:18 cph Exp $ +$Id: parse.scm,v 14.53 2004/11/19 06:51:20 cph Exp $ Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology Copyright 1992,1993,1994,1997,1998,1999 Massachusetts Institute of Technology @@ -485,13 +485,16 @@ USA. ((string-ci=? name "true") #t) ((string-ci=? name "optional") lambda-optional-tag) ((string-ci=? name "rest") lambda-rest-tag) + ((string-ci=? name "key") lambda-key-tag) ((string-ci=? name "aux") lambda-auxiliary-tag) ((string-ci=? name "eof") (make-eof-object #f)) + ((string-ci=? name "default") (default-object)) (else (error:illegal-named-constant name))))) (define lambda-optional-tag (object-new-type (ucode-type constant) 3)) (define lambda-rest-tag (object-new-type (ucode-type constant) 4)) (define lambda-auxiliary-tag '|#!aux|) +(define lambda-key-tag (object-new-type (ucode-type constant) 5)) (define (handler:unhash port db ctx char1 char2) db ctx char1 char2 diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index d34fd3fd7..87342f9be 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.512 2004/11/18 18:16:08 cph Exp $ +$Id: runtime.pkg,v 14.513 2004/11/19 06:51:30 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -2452,6 +2452,7 @@ USA. char-set/number-leaders char-set/symbol-quotes lambda-auxiliary-tag + lambda-key-tag lambda-optional-tag lambda-rest-tag) (export (runtime unsyntaxer) diff --git a/v7/src/runtime/unpars.scm b/v7/src/runtime/unpars.scm index a47cbaa1f..5b4505495 100644 --- a/v7/src/runtime/unpars.scm +++ b/v7/src/runtime/unpars.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: unpars.scm,v 14.57 2004/08/14 04:57:12 cph Exp $ +$Id: unpars.scm,v 14.58 2004/11/19 06:51:39 cph Exp $ Copyright 1986,1987,1990,1991,1992,1995 Massachusetts Institute of Technology Copyright 1996,2001,2002,2003,2004 Massachusetts Institute of Technology @@ -318,7 +318,9 @@ USA. ((eq? object #t) (*unparse-string "#t")) ((undefined-value? object) (*unparse-string "#[unspecified-return-value]")) + ((default-object? object) (*unparse-string "#!default")) ((eq? object lambda-auxiliary-tag) (*unparse-string "#!aux")) + ((eq? object lambda-key-tag) (*unparse-string "#!key")) ((eq? object lambda-optional-tag) (*unparse-string "#!optional")) ((eq? object lambda-rest-tag) (*unparse-string "#!rest")) (else (unparse/default object))))