caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] int_of_char vs Char.code
@ 2011-01-21 12:10 Joel Reymont
  2011-01-21 12:15 ` Maxence Guesdon
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Reymont @ 2011-01-21 12:10 UTC (permalink / raw)
  To: caml-list

I noticed that cryptokit uses Char.code to convert from char to int.

I also found int_of_char. 

Should I prefer one over another for performance reasons?

	Thanks, Joel

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] int_of_char vs Char.code
  2011-01-21 12:10 [Caml-list] int_of_char vs Char.code Joel Reymont
@ 2011-01-21 12:15 ` Maxence Guesdon
  0 siblings, 0 replies; 2+ messages in thread
From: Maxence Guesdon @ 2011-01-21 12:15 UTC (permalink / raw)
  To: Joel Reymont; +Cc: caml-list

On Fri, 21 Jan 2011 12:10:40 +0000
Joel Reymont <joelr1@gmail.com> wrote:

> I noticed that cryptokit uses Char.code to convert from char to int.
> 
> I also found int_of_char. 
> 
> Should I prefer one over another for performance reasons?

Both are defined the same way:
  external int_of_char : char -> int = "%identity" [pervasives.ml]
  external code: char -> int = "%identity" [char.ml]

so you can assume the same performance.

Regards,

Maxence

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-21 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21 12:10 [Caml-list] int_of_char vs Char.code Joel Reymont
2011-01-21 12:15 ` Maxence Guesdon

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).