very very new beginner

View: New views
1 Messages — Rating Filter:   Alert me  

very very new beginner

by orange09 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm very new to Ocaml. Since this is my first exercise and I cannot use Ocaml library to implement methods, I can only use list[], or ::, and patern matching. So Ocaml code seem to be very short but too difficult to understand. My quesion might be the easy one but I have to do it manually. My questiont is : how to add an element to the end of the list (let rec add_end l e =). If I can find the last element of list l, and what syntax to add element e after last element of l, and shoud I increase the length of list l by 1, or it gonna be grow automatic? Any helps or suggessions, really appreciate...