Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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           its fields;   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                            --Lao Tzu (Peter Merel, trans.)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: