From bfdc9e9fb51e55eca6bf598dfda6a57773fe0985 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 17 Jan 2018 20:02:06 -0800 Subject: [PATCH] Change strip-angle-brackets to work on symbols too. --- src/runtime/global.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 -- 2.25.1