Last active
December 15, 2020 04:53
-
-
Save jackfirth/c4d66bd7378aa3ef4e9576eda0c094a9 to your computer and use it in GitHub Desktop.
The worst racket string program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require racket/unsafe/ops) | |
(define s1 (string-append)) | |
(define s2 (string-append)) | |
(immutable? s1) ; false | |
(immutable? s2) ; false | |
(eq? s1 s2) ; true (!!!) | |
(unsafe-string->immutable-string! s1) ; changes s1 to immutable and returns s1 | |
(immutable? s1) ; true | |
(immutable? s2) ; true (!!!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment