Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I evaluate this OCaml line with tuareg mode's C-c C-e command?
    primarykey
    data
    text
    <p>Background: I'm using Emacs 23.3, OCaml 3.12.0 and tuareg 1.45.7. </p> <p>I'm looking at the <a href="http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf" rel="nofollow">Hickey OCaml book</a>, and trying to run the examples on pg. 157 of the book, 167 of the .pdf. The problem arises with the expression</p> <pre><code>type ’a blob = &lt; draw : unit; .. &gt; as ’a </code></pre> <p>When I type that into my emacs buffer in tuareg-mode, and try to evaluate it with <code>C-c C-e</code>, I get the following error in the caml toplevel:</p> <pre><code># type 'a blob = &lt; draw : unit; .. &gt; as ';; Characters 39-41: type 'a blob = &lt; draw : unit; .. &gt; as ';; ^^ Error: Syntax error </code></pre> <p>Notice how the final <code>a</code> doesn't appear in command sent to the toplevel. If I type the line into the toplevel directly, it works just fine:</p> <pre><code># type 'a blob = &lt; draw : unit; .. &gt; as 'a;; type 'a blob = 'a constraint 'a = &lt; draw : unit; .. &gt; </code></pre> <p>So my question is: Why doesn't this work, and how can I fix it? Updating tuareg doesn't seem to be an option: I've tried to use tuareg version 2.0, but that won't even load properly. </p> <p><strong>Update</strong>: This was fixed in the tuareg SVN trunk as of 12/8/12. I don't think they've updated the release with the fix, but you can grab the trunk anonymously with</p> <pre><code>svn checkout svn://svn.forge.ocamlcore.org/svn/tuareg/trunk </code></pre> <p>bearing in mind the usual caveats about development vs. release versions. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload