dgo.a
dgo.a

Reputation: 2764

Is it possible to get the codepoint of a CharLiteral at the Crystal compile time in a macro?

At the Crystal runtime, this is possible: '?'.ord

Is there anything similar for a Crystal macro?: {% 'a' %}

(I have no valid use case for this. It's just for esoteric reasons.)

Upvotes: 2

Views: 44

Answers (1)

bew
bew

Reputation: 503

No, this is currently not possible.

Here is the documentation about what you can do on a CharLiteral.

Upvotes: 1

Related Questions