<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/ccc2e51cee94b42e99f894931dc700df"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-01-24T10:34:16"
  subject="Re: [Caml-list] Function Indirection overhead?"
  prev="2003/01/b1070fc490cf3afca7675fa3eb7dfb03"
  next="2003/01/54c2e02506db532b8666d9fb01dd4594"
  prev-in-thread="2003/01/7af23fdb84955df7febee50c37327874"
  prev-thread="2003/01/d579dc7183e18352238ff4a8f4a069ee"
  next-thread="2003/01/bbfcc4a81696d676b28eef051f7f310f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Function Indirection overhead?">
<msg 
  url="2003/01/7af23fdb84955df7febee50c37327874"
  from="Vaibhav Bhandari &lt;vaibhav@c...&gt;"
  author="Vaibhav Bhandari"
  date="2003-01-24T07:21:08"
  subject="[Caml-list] Function Indirection overhead?">
<msg 
  url="2003/01/ccc2e51cee94b42e99f894931dc700df"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-01-24T10:34:16"
  subject="Re: [Caml-list] Function Indirection overhead?">
</msg>
</msg>
</thread>

<contents>
&gt; I am not sure, if in ocaml we write
&gt; 
&gt; let f = Hop.a;
&gt; 
&gt; where f and Hop.a are methods, does the compiler "short-circuit" the call,
&gt; or not?

Yes, it does.  Applications of function f will go straight to the code
for Hop.a.  Contrast this with

let f x = Hop.a x

where an additional call (from f to Hop.a) would occur.

- Xavier Leroy
-------------------
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

</contents>

</message>

