Skip to content

what's the syntax for character literal? #1570

Answered by sogaiu
Inc0n asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't a syntax for character literals AFAIU, however you can do a compile-time thing with:

(chr "a")
# =>
97

Note that this only works for strings of length one - so in janet's case that means a single byte.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Inc0n
Comment options

Answer selected by Inc0n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants