logo       

Re: ExtPervasives: msg#00010

Subject: Re: ExtPervasives
>     The name ExtPervasives is misleading, because
> there functions are not "pervasive" in the truest sense,
> however the name does fit with the pattern Ext+OCaml core
> library name.

ExtStd is perhaps a better name

> (* SML-like names; other have suggested alternates:
>    handling 'a options w/o match cases *)
> val val_of : 'a option -> 'a
> val is_some : 'a option -> bool

I moved theses as well some functions sent previously by Olivier into a new
module "Option"

module Option :
  sig
 val may : ('a -> unit) -> 'a option -> unit
 val map : ('a -> 'b) -> 'a option -> 'b option
 val default : 'a -> 'a option -> 'a
 val is_some : 'a option -> bool
 val is_none : 'a option -> bool
  end

> val string_of_bool : bool -> string

this one already exists :)

> val print_bool : bool -> unit
> val prerr_bool : bool -> unit

agree.
( When I agree and when it seems obvious that people will also agree, I'm
automaticaly adding it to my local ExtLib file , and then later I 'll review
it to do some commenting and renaming )

> val output_int : out_channel -> int -> unit
> val output_float : out_channel -> float -> unit
> ...etc for basic types...

Too much verbose I think. Since most of the time you're printing mixed kind
of values, fprintf is the best choice.
I wouldn't like to promote such a programming style

>     Also, although I don't have this, what do people think about:
>
> val input_int : in_channel -> int
> val input_float : in_channel -> float
> val input_string : in_channel -> string
>
>     Which would have similar semantics to the C++ ">>" operators:
> whitespace delimits tokens, but is otherwise ignored, and line
> breaks are just another whitespace delimiter.

Same remark : use Scanf module
... or xml :)

Nicolas Cannasse



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe