Class Lisp::Format::Directives::Character
In: lib/facet/lisp-format.rb
Parent: Directive

Represents the ~C (Character) directive. It outputs a character argument in one of several different representations depending on given modifiers. TODO: UNICODE this shit.

Methods

Public Instance methods

Outputs the given argument in one of the ways described in the table below depending on given modifiers:

no modifiers
simply output the character as a normal character,
:
spells out control-bits on the input character, such as Control-Meta-X,
@
outputs the character in such as way that it can be read in by the Ruby interpreter again as input, using the ?char syntax,
:@
has the same effect as : only. The CLTL2 suggests that this outputs unusual shift keys in a manner to make it easy to locate them on a keyboard, but since no such standard has arisen, this is not done.

Private Instance methods

Convert a character to a escaped character string if possible. XXX: This should perhaps only use \x or \NNN syntax

[Validate]