From: Damien Doligez <damien.doligez@inria.fr>
To: Liste Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] troubles with polymorphic variant in class
Date: Mon, 14 Jun 2004 11:48:59 +0200 [thread overview]
Message-ID: <0F7A5147-BDE8-11D8-9BC0-00039310CAE8@inria.fr> (raw)
In-Reply-To: <1087205340.8886.4.camel@Bess>
On Jun 14, 2004, at 11:29, François-Xavier HOUARD wrote:
> let l = a#get_child in
> match l with
> h::t -> (match h with
> myGui.User_variant v ->
> ( match v with
> MyText t -> .......
> | _ ->
> )
> | _ -> raise Not_found
> )
> ....
>
>
> Who the hell would use this ???
You don't really need to obfuscate your own code:
match a#get_child with
| MyGui.User_variant (MyText t) :: tt -> .......
| _ -> raise Not_found
....
-- Damien
-------------------
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:[~2004-06-14 9:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-13 16:05 François-Xavier HOUARD
2004-06-13 17:59 ` skaller
2004-06-14 9:29 ` François-Xavier HOUARD
2004-06-14 9:48 ` Damien Doligez [this message]
2004-06-14 15:49 ` skaller
2004-06-14 9:37 ` Richard Jones
2004-06-14 14:48 ` nakata keiko
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=0F7A5147-BDE8-11D8-9BC0-00039310CAE8@inria.fr \
--to=damien.doligez@inria.fr \
--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