Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Frustrated Beginner
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] Frustrated Beginner
On Tue, Dec 23, 2003 at 01:11:08AM -0500, Tyler Eaves wrote:

> >      match foo with
> >      | None -> print_endline "Nothing"; ""
> >      | Some x -> print_endline x; x
> 
> If I understand the match syntax correctly, in this case, x takes the 
> value of foo?

Not quite. foo can have a value of either None or Some s, where s is an
arbitrary string. So if foo has a value of Some "abcde", then x =
"abcde". Foo, by the way, has a type of string option.

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners