Re: code does not work as expected

"James Cloos (as cloos at jhcloos dot com)" <[email protected]> Fri, 10 Apr 2026 18:59:04 -0400
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
>>>>> "ID" == Igor Denisov (as defun-var at yandex dot ru) <[email protected]> writes:

ID> (format t "~a" (cdr (assoc (+ (* (get-num '(1 2) 0) 10) (get-num '(1 2) 1)) teens-alist))) ;;=> NIL
 
ID> format return must be twelve not NIL. Where is a mistake?

per https://www.lispworks.com/documentation/HyperSpec/Body/f_format.htm,
format returns:

  result---if destination is non-nil, then nil; otherwise, a string

so cl:format always returns nil when destination is t.

-JimC
-- 
James Cloos <[email protected]>
            OpenPGP: https://jhcloos.com/0x997A9F17ED7DAEA6.asc

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html