From: Chris Hanson Date: Mon, 30 Jan 2017 09:40:19 +0000 (-0800) Subject: Implement char->scalar-value. X-Git-Tag: mit-scheme-pucked-9.2.12~227^2~19 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7530278a8da931f6ccd06ff1b675e63283f3c402;p=mit-scheme.git Implement char->scalar-value. --- diff --git a/src/runtime/char.scm b/src/runtime/char.scm index 506904cff..aee593767 100644 --- a/src/runtime/char.scm +++ b/src/runtime/char.scm @@ -380,6 +380,11 @@ USA. (define-guarantee unicode-char "a Unicode character") (define-guarantee unicode-scalar-value "a Unicode scalar value") +(define (char->scalar-value char #!optional caller) + (let ((n (char->integer char))) + (guarantee unicode-scalar-value? n caller) + n)) + (define (unicode-char->scalar-value char #!optional caller) (guarantee unicode-char? char caller) (char->integer char)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 826dd1ce4..046eabde9 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -1339,6 +1339,7 @@ USA. char->digit char->integer char->name + char->scalar-value char-ascii? char-bit:control char-bit:hyper