<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 2010-03-28, at 11:18 PM, Gary Byers wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br><br>On Sun, 28 Mar 2010, Philippe Sismondi wrote:<br><br><blockquote type="cite">I have taken a month or two away from CL to learn obj-c/cocoa so that I can<br></blockquote><blockquote type="cite">use the cocoa bridge more knowledgeably. Now I am reading up on foreign<br></blockquote><blockquote type="cite">functions etc. in the ccl documentation.<br></blockquote><blockquote type="cite">Question:<br></blockquote><blockquote type="cite">The ccl doc section 12.12 The Foreign-Function-Interface Dictionary gives<br></blockquote><blockquote type="cite">this example:<br></blockquote><blockquote type="cite">(with-cstrs ((format-string "the answer is: %d"))<br></blockquote><blockquote type="cite">          (#_printf format-string :int answer))<br></blockquote><blockquote type="cite">This just returns an integer (19) when I key it in to ccl. Should I expect<br></blockquote><blockquote type="cite">it to print what it looks like it would print? What else must I do here? (I<br></blockquote><blockquote type="cite">had set 'answer' to an integer value.)<br></blockquote><blockquote type="cite"><br></blockquote><br>The C function "printf" writes to a C "FILE *" associated with the process's<br>standard output.  Where is that, exactly ?<br><br>If you're running in a terminal window, that's likely the terminal window.<br>If you're running in an Emacs shell buffer, that's likely that shell buffer.<br>]<br><font class="Apple-style-span" color="#006312"><font class="Apple-style-span" color="#144FAE"><snip...></font></font><blockquote type="cite"></blockquote></div></blockquote><br><br></div><div>Thanks, Gary. That clears it up.</div><div><br></div><div>After I posted I had lots of success using #_fopen, #_fprintf etc. from ccl. So the only complication was stdout which I can see no obvious need to use anyway. Trying examples from ccl documentation is just part of my learning process.</div><div><br></div><div>I'm a happy camper being back in the ccl world after my period of obj-c/cocoa learning. Obj-c and cocoa are pretty nice, but nowhere near as much fun as CL. So it's great to be able to get at C, obj-c and cocoa so nicely from ccl.</div><div><br></div><div>Best,</div><div><br></div><div>- Phil -</div><br></body></html>