Skip to content

Instantly share code, notes, and snippets.

@martialboniou
Created November 23, 2024 06:25
Show Gist options
  • Save martialboniou/43d217c1b392917f983b697a1951b91d to your computer and use it in GitHub Desktop.
Save martialboniou/43d217c1b392917f983b697a1951b91d to your computer and use it in GitHub Desktop.
Playing with Shen S39.1

I've recently checked the Shen Programming Language after a hiatus of 5/6 years. Dr Mark Tarver has made some good changes & improvements. But the default S39.1 in 2024 didn't work as expected on my SBCL version (2.4.10). string->n works with any character (ASCII, extended (LATIN..), UNICODE) if I consider SBCL *STANDARD-INPUT* as a character-based stream.

My knowledge is very limited here; The default choice for byte-based input stream might make sense in the long run (faster data streams) but for now, I can use the Shen REPL as I do with SBCL, Lua/Fennel or lein repl)

In Primitives/char-stinput.lsp:

#+SBCL
(DEFUN shen.char-stinput? (Stream) 
  (IF (EQ Stream *stinput*) 'true 'false))

After compilation:

(0-) (string->n "է")
1383

(1-) (string 233)
"é"

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment