Anonymous user
Menu: Difference between revisions
→{{header|Common Lisp}}: force-output suffices, move shorter if case first, indentation, use ~& at beginning of output
Underscore (talk | contribs) (Added Common Lisp.) |
(→{{header|Common Lisp}}: force-output suffices, move shorter if case first, indentation, use ~& at beginning of output) |
||
Line 61:
=={{header|Common Lisp}}==
<lang lisp>(defun select (prompt choices)
(if (null choices)
((and n (<= 0 n (1- (length choices))
(
for c in choices
do (format t " ~d) ~a~%" n c))
(
(setf n (parse-integer (read-line *standard-input* nil)
:junk-allowed t)))))</lang>▼
▲ :junk-allowed t)))
=={{header|Java}}==
|