From: Xavier Leroy <xavier.leroy@inria.fr>
To: "altavillasalvatore@libero.it" <altavillasalvatore@libero.it>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] small exercise
Date: Fri, 29 Nov 2002 16:29:57 +0100 [thread overview]
Message-ID: <20021129162957.C27468@pauillac.inria.fr> (raw)
In-Reply-To: <H6CFX2$DB3343D5BB847C637A82FD5C6BE8421E@libero.it>; from altavillasalvatore@libero.it on Fri, Nov 29, 2002 at 04:19:50PM +0100
> input: string "1.15.120.13.43.35.340.190.0"
> output: int array= [| 1; 15; 120; 13; 43; 35; 340; 190; 0; |]
That's easy:
let answer_to_the_exercise = function
"1.15.120.13.43.35.340.190.0" ->
[| 1; 15; 120; 13; 43; 35; 340; 190; 0; |]
I'm sure your professor will love this solution, as it is not only
correct w.r.t. the specification, but also quite concise.
- Xavier Leroy
P.S.1: this list isn't for doing student's homework.
P.S.2: the beginner's list http://groups.yahoo.com/group/ocaml_beginners
isn't either, but you might find more sympathy there.
-------------------
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
next prev parent reply other threads:[~2002-11-29 15:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-29 15:19 altavillasalvatore
2002-11-29 15:29 ` Xavier Leroy [this message]
2002-11-29 18:29 ` Pierre Weis
2002-11-29 15:30 ` Christophe Raffalli
2002-11-29 18:48 ` Pierre Weis
2002-11-29 15:32 ` Jean-Christophe Filliatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021129162957.C27468@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=altavillasalvatore@libero.it \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox