Character literals are literal tokens that evaluate to the integer (Fixnum) encoding of a character.

character_literal = ?char | ?\escape

The first form evaluates to the encoding (representation) of char, modulo 256.
The 2nd form evaluates to the value of escape, modulo 256.
char may not be a whitespace, or a multibyte character.
If char is a letter, digit or ‘_’, the next character may not be an identifier_char.

Examples

?x evaluates to: 120

?\f evaluates to: 9

?\277 evaluates to: 191

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: