[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Format's C



In answer to your query about FORMAT's C operation:
I suggest that the following informal definitions hold:

~C  Prints the argument as a character in the most concise format
    that will be unambiguous to a human reader and consistent with
    the conventions of his programming environment.
	Example: if alpha and beta are not available, one might print
	the character with ASCII code 30 octal as "C-X" or perhaps
	as "CTRL/X", depending on the conventions of the programming
	environment.  "C-X" might be preferred on grounds of conciseness.
	"^X" would also be acceptable.

~:C Prints the argument as a lengthy but English-readable (and therefore
    pronounceable) name.  Any "keywords" or "special names" should
    be capitalized full English words (to get all lowercase or all
    uppercase one can use STRING-DOWNCASE or STRING-UPCASE or whatever).
    The separator of choice is "-".
    [Footnote: I nearly tore into the LISP Machine's FORMAT to add
    uparrow and downarrow as modifer characters.  The idea was that
    uparrow would mean upper-case output, downarrow lower-case, and both
    together would mean capitalized.  I decided not to, because the arrows
    are not standard ASCII characters, and also to avoid arrest on the
    grounds of unwarranted baroqueness.]
	Examples:  Control-X, Meta-Space, Tab

~:@C Does the same thing, but adds a parenthetical remark describing how
    to type the character if in the judgement of the implementor it
    may not be obvious to the user how to input that character from the
    keyboard he is using.
	Examples: Control- (Top-A)    [MIT keyboard]
		  Control-_ (Shift--)   [stupid kbds where - and _ look alike]

~@C Prints the argument as a character in such a way that READ can
    reconstruct the argument, or its logical equivalent, from the output.
    Subject to this requirement, the output should be readable and concise
    to whatever extent possible.
	Examples:  #/X  #\RETURN  #\RETURN  #,(CONTROL #\RETURN)

Do these general descriptions seem reasonable?
--Guy