[pure-lang-svn] SF.net SVN: pure-lang: [318] pure/trunk/examples/hello.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-06-27 00:24:33
|
Revision: 318 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=318&view=rev Author: agraef Date: 2008-06-26 17:24:41 -0700 (Thu, 26 Jun 2008) Log Message: ----------- Add 'def' example. Modified Paths: -------------- pure/trunk/examples/hello.pure Modified: pure/trunk/examples/hello.pure =================================================================== --- pure/trunk/examples/hello.pure 2008-06-27 00:11:58 UTC (rev 317) +++ pure/trunk/examples/hello.pure 2008-06-27 00:24:41 UTC (rev 318) @@ -47,6 +47,12 @@ // Pattern matching definition with 'let'. let x, y = square x, square (x+2); x; y; +// We also have constant definitions using 'def' in lieu of 'let'. These +// cannot be redefined and are substituted directly into other definitions. +// Try something like 'foo x = pi*x;' and then 'list foo' to see the +// difference. +def pi = 3.14159265358979; + /* Variations on a theme: The factorial. This illustrates various different ways to define a simple recursive function. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |