Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Whers "Some()" is defined in Vine?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
upkevin  
View profile  
 More options Apr 12 2012, 4:27 am
From: upkevin <upke...@gmail.com>
Date: Thu, 12 Apr 2012 01:27:12 -0700 (PDT)
Local: Thurs, Apr 12 2012 4:27 am
Subject: Whers "Some()" is defined in Vine?
hello ,I am reading  the source codes of Vine. I find the Some() func
is important and used widely. but I could not know where it is
defined?  Is someone know ? Thanks !

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gustavo.gri...@gmail.com  
View profile  
 More options Apr 12 2012, 10:39 am
From: gustavo.gri...@gmail.com
Date: Thu, 12 Apr 2012 11:39:27 -0300
Local: Thurs, Apr 12 2012 10:39 am
Subject: Re: Whers "Some()" is defined in Vine?

You mean the option
module<http://ocaml-lib.sourceforge.net/doc/Option.html>that defines
Some type constructor?

2012/4/12 upkevin <upke...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen McCamant  
View profile  
 More options Apr 16 2012, 8:29 pm
From: Stephen McCamant <s...@CS.Berkeley.EDU>
Date: Mon, 16 Apr 2012 17:29:05 -0700
Local: Mon, Apr 16 2012 8:29 pm
Subject: Re: Whers "Some()" is defined in Vine?
GG> 2012/4/12 upkevin <upke...@gmail.com>
UK> hello ,I am reading the source codes of Vine. I find the Some()
UK> func is important and used widely. but I could not know where it
UK> is defined?  Is someone know ? Thanks !

>>>>> "GG" == gustavo grieco <gustavo.gri...@gmail.com> writes:

GG> You mean the option
GG> module<http://ocaml-lib.sourceforge.net/doc/Option.html>that
GG> defines Some type constructor?

To be precise, "Some" and its counterpart "None" are the constructors
of the "option" built-in type, whose definition is effectively just:

type 'a option = None | Some of 'a

The "Option" module from ExtLib you mention there contains some
additional functions that are useful in conjunction with option-typed
values. The Vine code tends to mostly just use "option" directly
without "Option", though the difference is mostly just a question of
style.

Values of option type are an idiom in ML-family languages for a value
that may or not be present. They fulfill a purpose somewhat similar to
the null values in SQL, C pointers, and Java references, the undefined
value in Perl, None in Python, and so on. But the ML option type
is stricter than these in that you have to explicitly account for the
possibility that a value might be missing every time you mention it.
So rather than having null pointer exceptions as in Java, or their
equivalents, the compiler checks that you have made explicit
everywhere what to do if a value is missing.

Option types should be covered in just about any full-length
introduction or tutorial for OCaml. If you haven't already read one of
these, and you want to read or modify the Vine source, it would
probably be a good idea. Here's an example from one of the first
Google hits:

http://mirror.ocamlcore.org/ocaml-tutorial.org/null_pointers,_asserts...

Hope this helps,

 -- Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »