From: Chris Hanson Date: Thu, 15 Jul 2004 04:05:39 +0000 (+0000) Subject: Implement SYMBOL. X-Git-Tag: 20090517-FFI~1621 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a535bab55777f92a6373348b79106e57e6b7ef62;p=mit-scheme.git Implement SYMBOL. --- diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 485b6f6f3..ddc6f5fc1 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.489 2004/07/04 05:28:56 cph Exp $ +$Id: runtime.pkg,v 14.490 2004/07/15 04:05:16 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -466,6 +466,7 @@ USA. string-head->symbol string-tail->symbol substring->symbol + symbol symbol->string symbol-append symbol-hash diff --git a/v7/src/runtime/symbol.scm b/v7/src/runtime/symbol.scm index 0739f7654..6a3240191 100644 --- a/v7/src/runtime/symbol.scm +++ b/v7/src/runtime/symbol.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: symbol.scm,v 1.14 2004/01/15 20:59:12 cph Exp $ +$Id: symbol.scm,v 1.15 2004/07/15 04:05:39 cph Exp $ Copyright 1992,1993,2001,2003,2004 Massachusetts Institute of Technology @@ -75,6 +75,20 @@ USA. (define (string-tail->symbol string start) ((ucode-primitive string->symbol) (string-tail string start))) + +(define (symbol . objects) + ((ucode-primitive string->symbol) + (apply string-append + (map (lambda (object) + (cond ((string? object) object) + ((symbol? object) (symbol-name object)) + ((number? object) (number->string object)) + ((not object) "") + (else + (error:wrong-type-argument object + "symbol component" + 'SYMBOL)))) + objects)))) (define (intern string) (if (string-lower-case? string)