From: "Jonathan Roewen" <jonathan.roewen@gmail.com>
To: "Carlos Pita" <cpitaper@yahoo.com.ar>
Cc: "Jacques Garrigue" <garrigue@math.nagoya-u.ac.jp>,
caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Why + vs +. but "fake" parametric polymorphism for <
Date: Thu, 12 Oct 2006 19:08:03 +1300 [thread overview]
Message-ID: <ad8cfe7e0610112308ld9c1bd3x9d028450b0fe8aa5@mail.gmail.com> (raw)
In-Reply-To: <1160632737.7649.34.camel@monad>
That's correct. As showed, specifying types somewhere (as I did with
the return type, and someone else did for a given parameter), type
inference deduces the types of the parameters and return values,
allowing it optimise.
let f x y : <t> = .... specifies the return type, or to annotate a
parameter, use (x:<t>) -- the parentheses are required, and <t> is a
placeholder for the type expression.
On 10/12/06, Carlos Pita <cpitaper@yahoo.com.ar> wrote:
>
> > Of course there is an overhead. But the compiler is clever enough to
> > remove this overhead when the types of arguments are statically known.
> > In particular this is true for floats.
>
> Oh, I see, so if I understand you it would be enough if I use an integer
> literal somewhere or explicitly declare some variable as int so the
> compiler can infer that the particular use of the comparison operator is
> being passed integer operands and consequently inline an specific,
> optimized-for-int, version of <. Am I wrong?
> Cheers,
> Carlos
>
>
>
>
>
> __________________________________________________
> Preguntá. Respondé. Descubrí.
> Todo lo que querías saber, y lo que ni imaginabas,
> está en Yahoo! Respuestas (Beta).
> ¡Probalo ya!
> http://www.yahoo.com.ar/respuestas
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
next prev parent reply other threads:[~2006-10-12 6:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 5:18 Carlos Pita
2006-10-12 5:45 ` [Caml-list] " Jacques Garrigue
2006-10-12 5:58 ` Carlos Pita
2006-10-12 6:08 ` Jonathan Roewen [this message]
[not found] ` <452DF46C.802@fmf.uni-lj.si>
2006-10-12 14:26 ` Carlos Pita
2006-10-13 11:56 ` Diego Olivier FERNANDEZ PONS
2006-10-13 12:14 ` Gerd Stolpmann
2006-10-13 12:46 ` Diego Olivier FERNANDEZ PONS
2006-10-13 13:01 ` Luc Maranget
2006-10-13 13:15 ` Diego Olivier FERNANDEZ PONS
2006-10-13 13:15 ` skaller
2006-10-13 13:36 ` Luc Maranget
2006-10-13 13:53 ` Gerd Stolpmann
2006-10-13 14:16 ` Luc Maranget
2006-10-12 5:19 Carlos Pita
2006-10-12 5:41 ` [Caml-list] " Carlos Pita
2006-10-12 5:49 ` Basile STARYNKEVITCH
2006-10-12 5:53 ` Jonathan Roewen
2006-10-12 6:10 ` Carlos Pita
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=ad8cfe7e0610112308ld9c1bd3x9d028450b0fe8aa5@mail.gmail.com \
--to=jonathan.roewen@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=cpitaper@yahoo.com.ar \
--cc=garrigue@math.nagoya-u.ac.jp \
/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;
as well as URLs for NNTP newsgroup(s).