<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.3790.2817" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>-module(tut1).<BR>-export([fac/1]).<BR><BR>fac(1)
-><BR> 1;<BR>fac(N) -><BR> N * fac(N -
1).<BR><FONT size=2>==================================</FONT></DIV>
<DIV><FONT size=2>How can i know the function will STOP at N=1?</FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>===================================</FONT></DIV></FONT></DIV>
<DIV>-module(tut4).<BR><BR>-export([list_length/1]).<BR><BR>list_length([])
-><BR> 0; <BR>list_length([First | Rest])
-><BR> 1 + list_length(Rest).<BR>
<DIV><FONT size=2>===================================</FONT></DIV>
<DIV><FONT size=2>How can i know the loop will stop when First=[
]?</FONT></DIV></DIV>
<DIV><FONT size=2>===================================</FONT></DIV>
<DIV><FONT size=2>How to explain theses code?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>In perl:</FONT></DIV>
<DIV><FONT size=2>for (my $i=0;$i<=10;$i++){</FONT></DIV>
<DIV><FONT size=2>....</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>It is very clear the process will stop when $i >
10.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV></BODY></HTML>