From: Chris Hanson Date: Thu, 18 Jan 2018 04:02:06 +0000 (-0800) Subject: Change strip-angle-brackets to work on symbols too. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~348 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bfdc9e9fb51e55eca6bf598dfda6a57773fe0985;p=mit-scheme.git Change strip-angle-brackets to work on symbols too. --- diff --git a/src/runtime/global.scm b/src/runtime/global.scm index b24344481..bc34ed172 100644 --- a/src/runtime/global.scm +++ b/src/runtime/global.scm @@ -342,10 +342,17 @@ USA. (object-new-type (ucode-type constant) 1)) (define (strip-angle-brackets name) - (if (and (string-prefix? "<" name) - (string-suffix? ">" name)) - (substring name 1 (fix:- (string-length name) 1)) - name)) + (let ((maybe-strip + (lambda (s) + (and (string-prefix? "<" s) + (string-suffix? ">" s) + (substring s 1 (fix:- (string-length s) 1)))))) + (if (string? name) + (or (maybe-strip name) name) + (let ((s (maybe-strip (symbol->string name)))) + (if s + (string->symbol s) + name))))) (define (for-each-interned-symbol procedure) (with-obarray-lock