Programming Challenge Numbers to Text?

Levi Pearson levi at cold.org
Fri May 5 14:19:50 MDT 2006


On May 5, 2006, at 2:04 PM, Shane Hathaway wrote:

> plug.org at 2nerds.com wrote:
>> This lisp expression:
>>   (format t "~r~%~r~%~r~%~r~%~r~%" 1 15 91283 4918239 2147483647)
>
> What does that really mean, and how would I find out?  What would  
> happen if I used only four "~r~%" sequences instead of five?  What  
> about i18n?  This looks very obtuse to me, and I would consider it  
> a mark *against* lisp.  I'd much rather use a function with a name  
> like "spell_int" than a series of symbols.  Is your syntax actually  
> helpful in some way I'm not seeing?

That is essentially equivalent to the following C-ish code:

fprintf(stdout, "%r\n%r\n%r\n%r\n%r\n", 1, 15, 91283, 4918239,  
2147483947);

%r, of course, would have to be a printf directive to do what ~r does  
in format.

You would find out by looking up the 'format' function in the manual,  
same as any other language.

I don't know how i18n is handled, but it wouldn't be terribly  
difficult for a Lisp vendor concerned about it to supply a i18nalized  
format function.

You sound very obtuse to me, and I would consider your comment a mark  
against you.

		--Levi


More information about the PLUG mailing list