<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Thomas,<div><br></div><div>thanks again for your "lecture in c thinking", this is very helpful for someone who made her way into programming, and IT in general, starting with Java 5 and Racket (pardon me, it used to be called scheme then :-; ) :-)</div><div><br><div><blockquote type="cite"><div><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><br>Correct, the caller has to provide a storage location for the output<br>she's interested in and may pass NULL to indicate that no storage has<br>been allocated because she's not interested in a return value.<br></div></blockquote><div><br></div><div>That's good to know, I really was not aware of such a convention - but it makes sense as soon as you think about pointers as "storage allocation"!</div><div>In fact I remember I've already told myself before to always think of "storage allocation" when I read "pointer", but when you're not exposed to something for a long time you just forget things ...</div><div><br></div><div><br></div><blockquote type="cite"><div><br>In C++ output parameters are often declared using reference types, which<br>are a special kind of pointer types that is always implicitly<br>dereferenced when used in expressions and cannot be set to NULL<br></div></blockquote><div><br></div><div><br></div><div>Yes, I think the C++ references were closer somehow to what I assumed (closer in "meaning"/intent I mean, not technically). (Not that I've worked with C++ too much either, just some very cursory exposure... :-;)</div><div><br></div><div><br></div><div>Thanks again,</div><div>Sigrid</div><div><br></div><div><br></div><br><blockquote type="cite"><div>explicitly (at least not if the expression used to do so is simple<br>enough for the compiler to realize what you're up to ;-)<br><br>If you declare a (_ptr o _something) type, racket always allocates space<br>for a something, passes the pointer to the foreign function and then<br>dereferences it to extract the _something after the foreign function<br>returns. Racket should indeed never pass a NULL pointer here.<br><br>Ciao,<br>Thomas<br><br><br>-- <br>When C++ is your hammer, every problem looks like your thumb.<br></div></blockquote></div><br></div></body></html>