Computer Chess Club Archives


Search

Terms

Messages

Subject: Slimmed "format"; no "loop"

Author: Steven Edwards

Date: 05:17:43 03/25/04

Go up one level in this thread


On March 25, 2004 at 07:34:05, Tord Romstad wrote:
>On March 25, 2004 at 07:10:53, Steven Edwards wrote:

>>Indeed, Common Lisp also has a format specifier for selecting and applying
>>singular/plural English suffixes based on the value of an argument.
>
>Yes, I forgot that one in my reply to Sune.
>
>CL-USER> (defun print-number-of-nodes (nodes)
>	   (format t "I have searched ~R node~P.~%" nodes nodes))
>
>CL-USER> (print-number-of-nodes 1)
>I have searched one node.
>NIL
>
>CL-USER> (print-number-of-nodes 2)
>I have searched two nodes.
>NIL

ChessLisp's format intrinsic is far, far simpler than Common Lisp's.  It has
only a few specifiers:

%q normal (quoted) form   "a day in the park" -> "a day in the park"
%u unquoted form             "a day in the park" -> a day in the park
%c cardinal integer             12 -> twelve
%o ordinal integer               123 -> one hundred twenty-third

More will be added if needed.

The Common Lisp spec for "loop" is far worse than "format".  It is a fine
example of why programming languages should NOT be designed by committee.
(ChessLisp has no "loop" intrinsic.)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.