<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Maybe I'm missing the point of the question, but I'm not sure I understand why that internal <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">define</code> is not equivalent to a <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">let</code>. It looks like the code is binding its value and then returning that value. Unless there's something going on here involving lazy evaluation or something? Without knowing more about how <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">cons-stream</code>, <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">scale-stream</code> and <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">add-streams</code> work, it's hard to know.</p>
<p dir="auto">Do you have a pointer into SICP (chapter, exercise number, etc.)?</p>
<p dir="auto">On 13 Dec 2021, at 14:04, Marco Antoniotti wrote:</p>
</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">Hi<br>
<br>
apologies for the stupid question. I was reviewing some teaching material<br>
and looked at the following Scheme (form SICP) code about "streams".<br>
<br>
(define (integral integrand initial-value dt)<br>
(define int<br>
(cons-stream initial-value<br>
(add-streams (scale-stream integrand dt)<br>
int)))<br>
int)<br>
<br>
The question is how you'd rendered it in Common Lisp or how you would<br>
provide some macrology to mimic the inner define. I know this has been<br>
asked before... I am sure somebody knows the answer.<br>
<br>
All the best<br>
<br>
-- <br>
Marco Antoniotti, Professor tel. +39 - 02 64 48<br>
79 01<br>
DISCo, Università Milano Bicocca U14 2043 <a href="http://dcb.disco.unimib.it" style="color:#777">http://dcb.disco.unimib.it</a><br>
Viale Sarca 336<br>
I-20126 Milan (MI) ITALY</p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>