Re: what did I do wrong here ?
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Hi, Roelof Wobben [email protected] [ocaml_beginners] wrote: > it helps but still im a little bit confused. > > What I try to do it this : > > lets say I want to calculate this 1+2+3 > then first 2+3 must be calculated and the outcome will be 5 > then 5+1 must be calculated so the outcome will be 6. > > Now there are no arguments anymore so the outcome must be displayed. > > But if there are no arguments so sum then the answer must be 0 > > and I use this as a example and here a= is used : # let rec factorial > a = if a = 1 then 1 else a * factorial (a - 1);; You might find these (very basic) videos help you to understand expressions. In particular videos 1 - 4: http://ocaml-book.com/videos/ Thanks, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/