<?php require_once "fs_inner_context.inc"; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">

<title><?php echo $HTML_TITLE; ?></title>

</head>

<?php echo html_bgcolor_body($BG_COLOR); ?>

<!-- Standard hierarchical header structure -->

<?php echo $CS_HEADER_HTML; ?>

<?php echo html_linked_text("<em>Courses</em>", $CS_COURSES_ROOT_URL); ?>

<?php echo $HTML_HEADER; ?>

<hr><hr>

<?php echo html_header($HTML_HEADER_LEVEL + 1, "Tips and Gotchas"); ?>

<ul>
	<li>Debug/Define Issue</li>
	<ul>
		<li>Trying to define things while in debug mode will give weird error messages - if you're having trouble defining things make sure you're not in debug mode.</li>
	</ul>
	<li>Define and Redefine Gotcha</li>
	<ul>
		<li>Be careful when defining an object to depend on another and then redefining the first one - the second one may not get updated, depending on the way you defined it. For example:
<pre>(define (f x) (+ x 2))
(define (g x) (f x))

(f 0) = 2
(g 0) = 2

(define (f x) (+ x 3))

(f 0) = 3
(g 0) = 3</pre>
		</li>
		<li>So no problem there. But this way:
<pre>(define (f x) (+ x 2))                                     
(define g f)                                            
                                                                                
(f 0) = 2                                                       
(g 0) = 2                                                       
                                                                                
(define (f x) (+ x 3))                                          
                                                                                
(f 0) = 3                                                       
(g 0) = 2</pre>                            
		you see the problem. Please note that this occurs in all cases where one object is defined to be another object, with no arguments provided - in all these cases the definition will need to be re-evaluated to update the first object. This can be annoying when doing testing - you may think to define test)result to be the result of the function you're testing, but test_result will not change if you change the function; hence, you may think your changes are having no effect, while in fact they are.</li> 
	</ul>
	<li>Modifying recursive functions</li>
	<ul>
		<li>If you're working on a recursive function, and you change its arguments, remember to change the recursive calls! This will save lots of time figuring out why it's complaining about its arguments being the wrong type. This also applies if you change it from the (define (name ...) body) syntax to the (define ((name ...) ...) body) syntax - the calls will need to be changed here too.</li>
	</ul>

<?php echo html_footer("index", 0, 1); ?>
<!-- hhmts start -->
Last modified: Thu Oct  3 17:50:40 CDT 2002
<!-- hhmts end -->

</body>

</html>
