<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eli Barzilay wrote at 07/10/2011 02:25 AM:<br>
<blockquote cite="mid:19993.17861.22732.798523@winooski.ccs.neu.edu"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">it should work as you originally expected, or it should raise an
error to complain about an internal "define" referencing itself like
that and ignoring the pre-existing binding from the argument.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
An error would be nice, but racket never did that.  Same as `letrec'.
  </pre>
</blockquote>
<br>
So, I think that this should be an error, given the current semantics:<br>
<br>
(define X X)<br>
<br>
Maybe that's an extremely simple example of a more general error of
attempting to evaluate an uninitialized variable.&nbsp; At least, I think
that the ones that can be proven statically to always be uninitialized
references should be compile errors.&nbsp; Or is there a good reason for the
compiler to be more liberal?<br>
<br>
Separately, I also think that maybe the following should be an error,
since someone doing this with internal-"define" instead of "let" is
most likely a student, and a student probably doesn't mean to do this:<br>
<br>
(define (foo name)<br>
&nbsp; (define name ...)<br>
&nbsp; ...)<br>
<br>
<div class="moz-signature">-- <br>
<a class="moz-txt-link-freetext" href="http://www.neilvandyke.org/">http://www.neilvandyke.org/</a>
</div>
</body>
</html>