Unicode in Racket on macOS
A brief guide to using Unicode in the Racket REPL on macOS.
Racket has built-in support for Unicode. It even uses it in keywords. For example, these two expressions are equivalent:
(lambda () "Hello") (λ () "Hello")
However, Unicode doesn’t work in the REPL by default (at least on macOS). Here’s one way to get it working:
Install the GNU Readline library with Homebrew.
brew install readline
Install the readline-gpl package.
raco pkg install readline-gpl
Change to the
libdirectory adjacent to where
cd /Applications/Racket\ v7.8/lib
Create a symbolic link to
ln -s /usr/local/opt/readline/lib/libreadline.dylib
racket again. If all went well, you can type all the λs you like.