<?xml version="1.0" encoding="utf-8"?>
<!--RSS generated by Flaimo.com RSS Builder [2013-05-20 14:47:42]-->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><docs>http://caml.inria.fr/mantis/</docs><link>http://caml.inria.fr/mantis/</link><description><![CDATA[MantisBT - Issues]]></description><title>MantisBT - Issues</title><image><title>MantisBT - Issues</title><url>http://caml.inria.fr/mantis/images/mantis_logo_button.gif</url><link>http://caml.inria.fr/mantis/</link><description><![CDATA[MantisBT - Issues]]></description></image><language>en</language><category>All Projects</category><ttl>10</ttl><dc:language>en</dc:language><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><item><title>0006016: non-recursive type declarations</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6016</link><description><![CDATA[All type declarations are by default recursive.  This is a problem when one wants to alias a type in a sub-module.  The classic solution is to create a &quot;proxy&quot; type:&lt;br /&gt;
&lt;br /&gt;
  type t&lt;br /&gt;
  module M = struct&lt;br /&gt;
    type tmp = t&lt;br /&gt;
    type t = tmp&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
At Jane Street we have been using a camlp4 extension to do that automatically when a type is marked with the keyword &quot;nonrec&quot;:&lt;br /&gt;
&lt;br /&gt;
  type t&lt;br /&gt;
  module M = struct&lt;br /&gt;
    type nonrec t = t&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
We believe it could be useful to everybody and it would be better to have it into the language proper, for instance to avoid polluting signatures with useless types everywhere.]]></description><category>OCaml typing</category><pubDate>Mon, 20 May 2013 09:17:43 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6016</guid><comments>http://caml.inria.fr/mantis/view.php?id=6016#bugnotes</comments></item><item><title>0006017: A new format implementation based on GADTs</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6017</link><description><![CDATA[I wrote a new implementation of formats unsing GADTs.&lt;br /&gt;
&lt;br /&gt;
It contains modifications of Printf, Format and Scanf standard library&lt;br /&gt;
modules, and OCaml typer adaptations (principally in typing/typecore.ml).&lt;br /&gt;
&lt;br /&gt;
In this new implementation, formats are compiled into GADTs trees by&lt;br /&gt;
the compiler and are &quot;evaluated&quot; by the printing and scanning functions.&lt;br /&gt;
The main advantages are :&lt;br /&gt;
 * No longer use of Obj.magic in printf.ml, scanf.ml and format.ml.&lt;br /&gt;
 * Better performances.&lt;br /&gt;
 * Stronger static verifications of format validity (flag compatibilities, ...).&lt;br /&gt;
 * Factorisation of format parsing in a single code (for all the stdlib&lt;br /&gt;
   and the OCaml compiler!) to ensure compatibility.&lt;br /&gt;
&lt;br /&gt;
This new version is &quot;mostly compatible&quot; with the old-one. Differencies are :&lt;br /&gt;
 * Some inconsistent formats are now statically rejected, like&lt;br /&gt;
   &quot;%1.1s&quot;, &quot;%#s&quot;, &quot;%0c&quot; (I had to slightly adapt the testsuite,&lt;br /&gt;
   principally to comment absud tests which no longer compile, so, obviously,&lt;br /&gt;
   I did not remove any test which still compile).&lt;br /&gt;
 * Some bug fixes :&lt;br /&gt;
   * The semantic of (printf &quot;%{...%}&quot;) (from comments of the testsuite).&lt;br /&gt;
   * The semantic of (scanf &quot;%[^...]@X&quot;).&lt;br /&gt;
   * The '@%' escape syntax, like in (Format.printf &quot;@%d%s&quot; 42 &quot;hello&quot;).&lt;br /&gt;
   * The managment of nested &quot;%{...%}&quot; and &quot;%(...%)&quot;.&lt;br /&gt;
   * Buffer overflows dues to too big padding (or precision).&lt;br /&gt;
   * ...&lt;br /&gt;
 * To obtain compatibility of Printf and Format formats, some '@' usages&lt;br /&gt;
   with an &quot;invalid Format-like syntax&quot; but a &quot;valid Printf-like syntax&quot;&lt;br /&gt;
   are now accepted by Format printing functions and literally printed.&lt;br /&gt;
   It is a small disadvantage because it is slightly less convenient to&lt;br /&gt;
   learn Format &quot;formatting info&quot; syntax by practice, sorry.&lt;br /&gt;
&lt;br /&gt;
Since the OCaml standard library and the OCaml compilers use formats, the&lt;br /&gt;
bootstrap is a bit complicated.&lt;br /&gt;
&lt;br /&gt;
I attach two patches (ocaml-4.00.1_new-formats_patch-{1,2}.diff) and&lt;br /&gt;
instructions to apply them into &quot;howto-apply-new-formats-patches.txt&quot;.&lt;br /&gt;
This .txt file can be used (with a slight adaptation from your config.)&lt;br /&gt;
as an installation shell-script.&lt;br /&gt;
&lt;br /&gt;
Please do not hesitate to send me any comments or questions about this code.&lt;br /&gt;
&lt;br /&gt;
Benoît Vaugon.]]></description><category>OCaml standard library</category><pubDate>Sun, 19 May 2013 17:21:15 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6017</guid><comments>http://caml.inria.fr/mantis/view.php?id=6017#bugnotes</comments></item><item><title>0006013: duplicate locations cause 'unused warnings' to be lost</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6013</link><description><![CDATA[The typer considers that either all the identifiers with a given name at a given location are used, or none or them are used.&lt;br /&gt;
&lt;br /&gt;
One consequence is that warnings may not be given for the code generated by camlp4 extensions because the positions are usually duplicated. For instance if you write:&lt;br /&gt;
&lt;br /&gt;
    type t = [ `a | `A ] with variants&lt;br /&gt;
&lt;br /&gt;
the generated code will contain&lt;br /&gt;
&lt;br /&gt;
    let fold ~a:a_fun ~a:a_fun ... = ... use a_fun twice ...&lt;br /&gt;
&lt;br /&gt;
But no warning will be given. This is a regression compared to 3.12.]]></description><category>OCaml general</category><pubDate>Fri, 17 May 2013 18:40:53 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6013</guid><comments>http://caml.inria.fr/mantis/view.php?id=6013#bugnotes</comments></item><item><title>0006012: object-like notation for module functions</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6012</link><description><![CDATA[  I have been recently translating a lot of code from C++ to OCaml, but without using OCaml objects (for my purpose, they trigger errors that are hardly understandable by beginners...). I usually end up translating a lot of calls of the form:&lt;br /&gt;
&lt;br /&gt;
self.meth(args) &lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
ClassModule.meth self args&lt;br /&gt;
&lt;br /&gt;
  While it is easy to do it using replace-regexp, I was wondering if it would not be worth adding a simple syntax for that, that could also be used in a more general context to reduce the size of code to look like object-oriented code without using objects. The idea is that a common idiom in OCaml is to put all the functions working on a specific type in a module, and thus, if we can associate syntactically an identifier with such a module, we can use some object-oriented notation to access all these functions for this identifier (here, I will use &quot;-&gt;&quot; for that).&lt;br /&gt;
&lt;br /&gt;
In the above example, when &quot;self&quot; would be introduced in the context, it would be associated with ClassModule (like a type annotation):&lt;br /&gt;
&lt;br /&gt;
let f (self -&gt; ClassModule) =&lt;br /&gt;
   ...&lt;br /&gt;
   self-&gt;meth1 args;&lt;br /&gt;
   self-&gt;meth2 args;&lt;br /&gt;
   self-&gt;meth3 args;&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
With arrays:&lt;br /&gt;
&lt;br /&gt;
let list_plus_length ( l -&gt; List ) =&lt;br /&gt;
  let len = l-&gt;length in&lt;br /&gt;
  l--&gt;map (fun i -&gt; i + len)  (* --&gt; put &quot;l&quot; as the second argument of List.map *)&lt;br /&gt;
&lt;br /&gt;
Note that it is not purely syntactic, it must be done with the knowledge of scopes, i.e. during typing. An extension would be to associate modules with types, so that type knowledge would trigger the correct use of functions :&lt;br /&gt;
&lt;br /&gt;
type string -&gt; String&lt;br /&gt;
&lt;br /&gt;
let len (s : string) = s-&gt;length&lt;br /&gt;
&lt;br /&gt;
Another advantage of such a notation would be that editors could use their knowledge of the module associated with the identifier to propose completions within that module.&lt;br /&gt;
&lt;br /&gt;
Anybody else interested in having such a notation ?]]></description><category>OCaml general</category><pubDate>Fri, 17 May 2013 18:36:29 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6012</guid><comments>http://caml.inria.fr/mantis/view.php?id=6012#bugnotes</comments></item><item><title>0006015: Negative integer and float literals</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6015</link><description><![CDATA[I never understood this behaviour:&lt;br /&gt;
&lt;br /&gt;
# sin -3.14;;&lt;br /&gt;
Error: This expression has type float -&gt; float&lt;br /&gt;
but an expression was expected of type int&lt;br /&gt;
&lt;br /&gt;
# pred -1;;&lt;br /&gt;
Error: This expression has type int -&gt; int&lt;br /&gt;
but an expression was expected of type int&lt;br /&gt;
&lt;br /&gt;
If you follow the grammar production of the docs from expr [1] to integer or float literals the above programs should be interpreted correctly. So what is wrong the lexer [4,5] or the docs ? &lt;br /&gt;
&lt;br /&gt;
Either one should be fixed (and I'd prefer the lexer to be fixed). &lt;br /&gt;
&lt;br /&gt;
[1] &lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/expr.html#expr&quot;&gt;http://caml.inria.fr/pub/docs/manual-ocaml/expr.html#expr&lt;/a&gt; [&lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/expr.html#expr&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
[2] &lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#float-literal&quot;&gt;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#float-literal&lt;/a&gt; [&lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#float-literal&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
[3] &lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#integer-literal&quot;&gt;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#integer-literal&lt;/a&gt; [&lt;a href=&quot;http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#integer-literal&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
[4] &lt;a href=&quot;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L246&quot;&gt;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L246&lt;/a&gt; [&lt;a href=&quot;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L246&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
[5] &lt;a href=&quot;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L248&quot;&gt;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L248&lt;/a&gt; [&lt;a href=&quot;https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L248&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]]]></description><category>OCaml documentation</category><pubDate>Fri, 17 May 2013 18:29:11 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6015</guid><comments>http://caml.inria.fr/mantis/view.php?id=6015#bugnotes</comments></item><item><title>0006000: Warning 40 ("Constructor or label name out of scope") should be an error</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6000</link><description><![CDATA[We have had record disambiguation on trunk now for a few months,&lt;br /&gt;
and I think that it would be wise to look again at the issue of&lt;br /&gt;
out of scope labels and constructors before the next major&lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
The issue is around the new ability to use a constructor or label&lt;br /&gt;
even though that constructor or label is not in scope, as long as&lt;br /&gt;
the type information is available.&lt;br /&gt;
&lt;br /&gt;
For example, the following is allowed:&lt;br /&gt;
&lt;br /&gt;
  module M = struct&lt;br /&gt;
    type foo = Foo&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  let x: M.foo = Foo&lt;br /&gt;
&lt;br /&gt;
Note that previously this would be rejected, forcing the user to&lt;br /&gt;
write:&lt;br /&gt;
&lt;br /&gt;
  let x = M.Foo&lt;br /&gt;
&lt;br /&gt;
Currently, using this feature produces a warning (40 &quot;Constructor&lt;br /&gt;
or label name used out of scope&quot;), however I think that it should&lt;br /&gt;
be upgraded to a full error.&lt;br /&gt;
&lt;br /&gt;
This was discussed in &lt;a href=&quot;http://caml.inria.fr/mantis/view.php?id=5759&quot;&gt;0005759&lt;/a&gt;, however more issues have emerged&lt;br /&gt;
since that discussion, and I think now is a good time to&lt;br /&gt;
re-evaluate this descision.&lt;br /&gt;
&lt;br /&gt;
My arguments against allowing out of scope labels and&lt;br /&gt;
constructors are as follows:&lt;br /&gt;
&lt;br /&gt;
- It allows references to constructors to be used in files that&lt;br /&gt;
  contain no reference to the file defining those&lt;br /&gt;
  constructors. For example, I have already come across the&lt;br /&gt;
  following code in the wild:&lt;br /&gt;
&lt;br /&gt;
    (* types.ml *)&lt;br /&gt;
      ...&lt;br /&gt;
      module Project = struct&lt;br /&gt;
        ...&lt;br /&gt;
        type project = {&lt;br /&gt;
          project_id: string;&lt;br /&gt;
          ...&lt;br /&gt;
        }&lt;br /&gt;
        ...&lt;br /&gt;
      end&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
    (* data.ml *)&lt;br /&gt;
      ...&lt;br /&gt;
      open Types&lt;br /&gt;
      ...&lt;br /&gt;
      module Projects = struct&lt;br /&gt;
        open Project&lt;br /&gt;
        module Platform = struct&lt;br /&gt;
  &lt;br /&gt;
          let project =&lt;br /&gt;
            { project_id=&quot;platform&quot;; &lt;br /&gt;
              ...&lt;br /&gt;
            }&lt;br /&gt;
          ...&lt;br /&gt;
        end&lt;br /&gt;
        ...&lt;br /&gt;
        let all = [ Platform.project; ... ]&lt;br /&gt;
        ...&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
    (* gantt.ml *)&lt;br /&gt;
      ...&lt;br /&gt;
      open Data&lt;br /&gt;
      ...&lt;br /&gt;
      List.map Projects.all&lt;br /&gt;
        ~f:(fun proj -&gt; ... proj.project_id ...)&lt;br /&gt;
      ...&lt;br /&gt;
&lt;br /&gt;
  Note that gantt.ml uses project_id but contains no reference to&lt;br /&gt;
  types.ml where that label is defined. When a bug occurred, it&lt;br /&gt;
  was non-trivial to fix due to the difficulty of finding the&lt;br /&gt;
  appropriate definition of project_id. This bug caused a lot of&lt;br /&gt;
  confusion among less experienced OCaml programmers, and I think&lt;br /&gt;
  that it is a very bad idea to allow it.&lt;br /&gt;
&lt;br /&gt;
- It only works &quot;in the presence of type information&quot;. This is an&lt;br /&gt;
  unspecifed criteria that most users will probably find&lt;br /&gt;
  confusing.&lt;br /&gt;
&lt;br /&gt;
- It doesn't work with GADTs. If the constructor in question is&lt;br /&gt;
  declared using GADT syntax then it cannot be used out of scope.&lt;br /&gt;
&lt;br /&gt;
- It can't work with exceptions.&lt;br /&gt;
&lt;br /&gt;
- It won't work with &quot;open types&quot; (&lt;a href=&quot;http://caml.inria.fr/mantis/view.php?id=5584&quot;&gt;0005584&lt;/a&gt;) or &quot;pattern synonyms&quot;&lt;br /&gt;
  which may be added to the language in future.&lt;br /&gt;
&lt;br /&gt;
- It will confuse users by adding a small element of structural&lt;br /&gt;
  typing to an otherwise nominative system. I think that most&lt;br /&gt;
  users picture variant constructors as named values, and all&lt;br /&gt;
  named values in OCaml obey the same scoping rules. To suddenly&lt;br /&gt;
  allow these values to be used as if they were not named values,&lt;br /&gt;
  but structural values (like the methods in an object) will&lt;br /&gt;
  confuse people.&lt;br /&gt;
&lt;br /&gt;
In return for these issues, all that we gain is the ability to&lt;br /&gt;
refer to out of scope constructors and labels without using a&lt;br /&gt;
module name, but only under certain difficult to define&lt;br /&gt;
conditions.&lt;br /&gt;
&lt;br /&gt;
Last time that this issue was discussed, it only appeared to be&lt;br /&gt;
discussed by 4 people. I think perhaps it would be a good idea&lt;br /&gt;
to get wider feedback before including a potentially risky&lt;br /&gt;
feature like this in a release.&lt;br /&gt;
&lt;br /&gt;
It is also worth pointing out that it would be easier to add this&lt;br /&gt;
feature in the future than to remove it later if it causes&lt;br /&gt;
problems.]]></description><category>OCaml typing</category><pubDate>Fri, 17 May 2013 16:07:54 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6000</guid><comments>http://caml.inria.fr/mantis/view.php?id=6000#bugnotes</comments></item><item><title>0005980: Maybe a new warning for M.() notation ?</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5980</link><description><![CDATA[While generally useful I think that the M.() notation may sometimes lead to subtle bugs when used as an expression.&lt;br /&gt;
&lt;br /&gt;
Suppose I have M with this signature:&lt;br /&gt;
&lt;br /&gt;
module M : sig&lt;br /&gt;
  type t &lt;br /&gt;
  val id : t &lt;br /&gt;
  val ( + ) : t -&gt; t -&gt; t&lt;br /&gt;
  ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
And I code this function: &lt;br /&gt;
&lt;br /&gt;
let f () = &lt;br /&gt;
  let (id : t) = ... in &lt;br /&gt;
  let (c : t) = ... in &lt;br /&gt;
  M.(id + c) &lt;br /&gt;
&lt;br /&gt;
I would like a warning that tells me that in M.(id + c), id is overriding a local variable. Note that a few cases are already covered by current warnings/errors. &lt;br /&gt;
&lt;br /&gt;
1) If the local id not used elsewhere in f you will have (an initially puzzling) unused variable warning -- however that warning doesn't cover pattern matching variables. &lt;br /&gt;
&lt;br /&gt;
2) If M.id was of another type you'd get an (aswell puzzling) type mismatch error. &lt;br /&gt;
&lt;br /&gt;
I think that failing to have such a warning by default somehow renders all M.(e), where e binds local variables quite brittle and suspicious.  &lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
&lt;br /&gt;
Daniel]]></description><category>OCaml general</category><pubDate>Fri, 17 May 2013 14:55:01 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5980</guid><comments>http://caml.inria.fr/mantis/view.php?id=5980#bugnotes</comments></item><item><title>0005982: caml_leave_blocking section and errno corruption</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5982</link><description><![CDATA[This is a widespread idiom for writing C stubs:&lt;br /&gt;
&lt;br /&gt;
    enter_blocking_section();&lt;br /&gt;
    retcode = select(maxfd + 1, &amp;read, &amp;write, &amp;except, tvp);&lt;br /&gt;
    leave_blocking_section();&lt;br /&gt;
    if (retcode == -1) uerror(&quot;select&quot;, Nothing);&lt;br /&gt;
&lt;br /&gt;
Here [uerror] uses the global variable [errno].  The problem is that [leave_blocking_section] can run arbitrary code and so modify [errno].  It can run signal handlers for instance.  Attached is an example of program where the call to select is expected to fail with EINTR but instead fails with EROFS.&lt;br /&gt;
&lt;br /&gt;
Obviously bindings should be written this way:&lt;br /&gt;
&lt;br /&gt;
    enter_blocking_section();&lt;br /&gt;
    retcode = select(maxfd + 1, &amp;read, &amp;write, &amp;except, tvp);&lt;br /&gt;
    saved_errno = errno;&lt;br /&gt;
    leave_blocking_section();&lt;br /&gt;
    if (retcode == -1) unix_error(saved_errno, &quot;select&quot;, Nothing);&lt;br /&gt;
&lt;br /&gt;
But since this is very common I propose that [leave_blocking_section] saves and restores [errno].]]></description><category>OCaml runtime system</category><pubDate>Tue, 14 May 2013 18:04:35 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5982</guid><comments>http://caml.inria.fr/mantis/view.php?id=5982#bugnotes</comments></item><item><title>0006014: Existentials not allowed with 'let and'</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6014</link><description><![CDATA[Given&lt;br /&gt;
&lt;br /&gt;
   type t = T : 'a -&gt; t&lt;br /&gt;
&lt;br /&gt;
the following is accepted:&lt;br /&gt;
&lt;br /&gt;
   let T x = T 3 in ()&lt;br /&gt;
&lt;br /&gt;
but a slight variant using 'let and' (or 'let rec and') is rejected:&lt;br /&gt;
&lt;br /&gt;
   let T x = T 3 and () = () in ()&lt;br /&gt;
&lt;br /&gt;
with the message:&lt;br /&gt;
&lt;br /&gt;
   Error: Unexpected existential]]></description><category>OCaml typing</category><pubDate>Tue, 14 May 2013 15:20:44 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6014</guid><comments>http://caml.inria.fr/mantis/view.php?id=6014#bugnotes</comments></item><item><title>0005874: Improve error message for polymorphic variant</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5874</link><description><![CDATA[Polymorphic variant is really a nice feature, but it's not widely used due to a not very instructive  error message (I guess).  In most cases, some errors are caused by a typo(the variant name typed wrong, or the arity lost), I think it may not be too hard to give some suggestions instead of  a very large error string which may scared the users&lt;br /&gt;
Thanks!]]></description><category>OCaml typing</category><pubDate>Fri, 10 May 2013 16:50:12 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5874</guid><comments>http://caml.inria.fr/mantis/view.php?id=5874#bugnotes</comments></item><item><title>0005910: assembler complains of invalid code</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5910</link><description><![CDATA[Running 'opam install ocamlnet' the build always stops due to errors in the generated assmbler code.&lt;br /&gt;
The computer is a raspberrypi with a patched ocaml compiler.&lt;br /&gt;
&lt;br /&gt;
root@raspberrypi:~# ocamlc -v&lt;br /&gt;
The OCaml compiler, version 4.00.1&lt;br /&gt;
Standard library directory: /root/.opam/4.00.1+raspberrypi/lib/ocaml&lt;br /&gt;
&lt;br /&gt;
root@raspberrypi:~# uname -a&lt;br /&gt;
Linux raspberrypi 3.2.27+ &lt;a href=&quot;http://caml.inria.fr/mantis/view.php?id=250&quot;&gt;0000250&lt;/a&gt; PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
result from 'opam install --debug ocamlnet 2&gt; opam.err'&lt;br /&gt;
root@raspberrypi:~# tail opam.err -n30&lt;br /&gt;
...&lt;br /&gt;
make[1]: Leaving directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'&lt;br /&gt;
make[1]: Entering directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'&lt;br /&gt;
ocamlfind ocamlopt  -I ../../src/netsys -I ../../src/netstring -I ../../src/netgssapi -package &quot;cryptokit unix&quot;  -c  netmech_scram.ml&lt;br /&gt;
make[1]: Leaving directory `/root/.opam/4.00.1+raspberrypi/build/ocamlnet.3.6.0/src/netmech-scram'&lt;br /&gt;
### stderr ###&lt;br /&gt;
...[truncated]&lt;br /&gt;
Warning 11: this match case is unused.&lt;br /&gt;
File &quot;nethttpd_services.ml&quot;, line 1118, characters 4-5:&lt;br /&gt;
Warning 11: this match case is unused.&lt;br /&gt;
/tmp/camlasm26c358.s: Assembler messages:&lt;br /&gt;
/tmp/camlasm26c358.s:9540: Error: shift expression is too large&lt;br /&gt;
/tmp/camlasm26c358.s:9632: Error: shift expression is too large&lt;br /&gt;
File &quot;netmech_scram.ml&quot;, line 1:&lt;br /&gt;
Error: Assembler error, input left in file /tmp/camlasm26c358.s&lt;br /&gt;
make[1]: *** [netmech_scram.cmx] Fel 2&lt;br /&gt;
make: *** [opt] Fel 2&lt;br /&gt;
&lt;br /&gt;
[17247] 17247                unlocking /root/.opam/4.00.1+raspberrypi/lock&lt;br /&gt;
'opam install --debug eliom' failed.]]></description><category>OCaml backend (code generation)</category><pubDate>Fri, 10 May 2013 08:33:27 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5910</guid><comments>http://caml.inria.fr/mantis/view.php?id=5910#bugnotes</comments></item><item><title>0006011: Signatures with private types can make modules less constrained</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6011</link><description><![CDATA[The following code behaves in a very unintuitive way that seems like a bug:&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
module FA (U : sig end) : sig type t = private int end = struct type t = int end&lt;br /&gt;
module FB (U : sig end) = FA (U)&lt;br /&gt;
(* module FB (U : sig end) : sig type t = private int end = FA (U) *)&lt;br /&gt;
module M : sig type t = private int end = FB (struct end)&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
It will fail with:&lt;br /&gt;
&lt;br /&gt;
----------&lt;br /&gt;
File &quot;foo.ml&quot;, line 4, characters 42-57:&lt;br /&gt;
Error: Signature mismatch:&lt;br /&gt;
       Modules do not match:&lt;br /&gt;
         sig type t end&lt;br /&gt;
       is not included in&lt;br /&gt;
         sig type t = private int end&lt;br /&gt;
       Type declarations do not match:&lt;br /&gt;
         type t&lt;br /&gt;
       is not included in&lt;br /&gt;
         type t = private int&lt;br /&gt;
       File &quot;foo.ml&quot;, line 4, characters 20-35: Expected declaration&lt;br /&gt;
       File &quot;foo.ml&quot;, line 1, characters 35-50: Actual declaration&lt;br /&gt;
EXIT STATUS 2&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
However, using the commented-out definition of functor FB instead of the previous one will make the file pass the type checker.  This is weird, because adding a signature should make a module more constrained, not less so.&lt;br /&gt;
&lt;br /&gt;
It seems that without &quot;type t = private int&quot; acting as a reminder in the definition of FB, the compiler will forget about it and treat type t as fully abstract from then on, even though it shouldn't be.]]></description><category>OCaml typing</category><pubDate>Wed, 08 May 2013 16:13:12 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6011</guid><comments>http://caml.inria.fr/mantis/view.php?id=6011#bugnotes</comments></item><item><title>0006006: Cannot "ocamlopt" the expression "x mod 1" on ARM</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6006</link><description><![CDATA[When I tried to compile ocamlnet on a Pandaboard the compiler failed with the messages&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
/tmp/camlasm0de67d.s: Assembler messages:&lt;br /&gt;
/tmp/camlasm0de67d.s:9339: Error: shift expression is too large -- `mov r0,r1,lsl#32'&lt;br /&gt;
/tmp/camlasm0de67d.s:9431: Error: shift expression is too large -- `mov r4,r5,lsl#32'&lt;br /&gt;
File &quot;netmech_scram.ml&quot;, line 1:&lt;br /&gt;
Error: Assembler error, input left in file /tmp/camlasm0de67d.s&lt;br /&gt;
make[1]: *** [netmech_scram.cmx] Fehler 2&lt;br /&gt;
make: *** [opt] Fehler 2]]></description><category>OCaml backend (code generation)</category><pubDate>Wed, 08 May 2013 15:25:35 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6006</guid><comments>http://caml.inria.fr/mantis/view.php?id=6006#bugnotes</comments></item><item><title>0005994: Error: shift expression is too large</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5994</link><description><![CDATA[When trying to compile another project (the Haxe language compiler), Ocaml produces invalid assembly and compilation fails.&lt;br /&gt;
&lt;br /&gt;
This is on a Raspberry Pi, compiled on the pi. I compiled Ocaml myself. Haxe is being built with ocamlopt.&lt;br /&gt;
&lt;br /&gt;
Exact error:&lt;br /&gt;
ocamlopt -g -I libs/extlib -I libs/extc -I libs/neko -I libs/javalib -I libs/ziplib -I libs/swflib -I libs/xml-light -I libs/ttflib -c main.ml&lt;br /&gt;
/tmp/camlasmb25bdd.s: Assembler messages:&lt;br /&gt;
/tmp/camlasmb25bdd.s:26774: Error: shift expression is too large -- `mov r6,r7,lsl#32']]></description><category>OCaml backend (code generation)</category><pubDate>Wed, 08 May 2013 15:25:21 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5994</guid><comments>http://caml.inria.fr/mantis/view.php?id=5994#bugnotes</comments></item><item><title>0006010: Big_int.extract_big_int does not handle negative numbers properly</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6010</link><description><![CDATA[This bug has been originally reported in Debian by Drake Wilson at:&lt;br /&gt;
&lt;br /&gt;
  &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707127&quot;&gt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707127&lt;/a&gt; [&lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707127&quot; target=&quot;_blank&quot;&gt;^&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
Big_int.extract_big_int does not handle negative numbers properly.&lt;br /&gt;
&lt;br /&gt;
This function seems to assume that unrepresented prefix regions of&lt;br /&gt;
bits in a Big_int.big_int are always zero, but this is not so for&lt;br /&gt;
negative numbers.  The documentation explicitly states that a two's&lt;br /&gt;
complement representation is used for those, but see the transcript&lt;br /&gt;
with comments inline.]]></description><category>OCaml otherlibs</category><pubDate>Wed, 08 May 2013 10:44:38 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6010</guid><comments>http://caml.inria.fr/mantis/view.php?id=6010#bugnotes</comments></item><item><title>0006009: Format.{pp_print_opt, pp_print_list, pp_print_text}</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6009</link><description><![CDATA[Ok, this time I got too tired of copy pasting that code. &lt;br /&gt;
&lt;br /&gt;
First an option pretty printer.&lt;br /&gt;
&lt;br /&gt;
(** [pp_print_opt pp_none pp_v ppf o] prints the optional value v. [pp_v] is used if [o] is [Some], &lt;br /&gt;
     [pp_none] if [o] is [None] (default prints nothing). *)&lt;br /&gt;
&lt;br /&gt;
let pp_print_opt ?(pp_none = fun ppf () -&gt; ()) pp_v ppf = function &lt;br /&gt;
| None -&gt; pp_none ppf ()&lt;br /&gt;
| Some v -&gt; pp_v ppf v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then a list pretty printer.&lt;br /&gt;
&lt;br /&gt;
(** [pp_print_list pp_sep pp_v ppf l] prints the list [l]. [pp_v] is used on the elements of [l] and &lt;br /&gt;
     each element is separated by a call to [pp_sep] (defaults to {!pp_print_cut}). Does nothing on &lt;br /&gt;
     empty lists. *)&lt;br /&gt;
&lt;br /&gt;
let rec pp_print_list ?(pp_sep = Format.pp_print_cut) pp_v ppf = function &lt;br /&gt;
| [] -&gt; ()&lt;br /&gt;
| v :: vs -&gt; &lt;br /&gt;
    pp_v ppf v; if vs &lt;&gt; [] then (pp_sep ppf (); pp_print_list ~pp_sep pp_v ppf vs)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then a string printer that hints newlines and spaces with Format's functions.&lt;br /&gt;
&lt;br /&gt;
(** [pp_print_text ?nl ppf s] prints [s] with spaces and newlines respectively printed with&lt;br /&gt;
     {!pp_print_space} and {!pp_force_newline}. *)&lt;br /&gt;
&lt;br /&gt;
let pp_print_text ppf s =          (* hint spaces and new lines with Format's funs *)&lt;br /&gt;
  let len = String.length s in&lt;br /&gt;
  let left = ref 0 in&lt;br /&gt;
  let right = ref 0 in &lt;br /&gt;
  let flush () =&lt;br /&gt;
    Format.pp_print_string ppf (String.sub s !left (!right - !left)); &lt;br /&gt;
    incr right; left := !right;                      &lt;br /&gt;
  in&lt;br /&gt;
  while (!right &lt;&gt; len) do &lt;br /&gt;
    if s.[!right] = '\n' then (flush (); Format.pp_force_newline ppf ()) else&lt;br /&gt;
    if s.[!right] = ' ' then (flush (); Format.pp_print_space ppf ()) else &lt;br /&gt;
    incr right&lt;br /&gt;
  done;&lt;br /&gt;
  if !left &lt;&gt; len then flush ()]]></description><category>OCaml standard library</category><pubDate>Tue, 07 May 2013 19:37:49 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6009</guid><comments>http://caml.inria.fr/mantis/view.php?id=6009#bugnotes</comments></item><item><title>0005407: Inline submodules, single-page HTML</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5407</link><description><![CDATA[Would it be possible to have the two following options:&lt;br /&gt;
&lt;br /&gt;
1. keep the documentation of submodules on the same HTML page as the parent module (or compilation unit)&lt;br /&gt;
&lt;br /&gt;
2. produce a single HTML page instead of about one per source file (implies option (1))&lt;br /&gt;
&lt;br /&gt;
Both would make search easier, especially when the modules or submodules are many and small.]]></description><category>OCamldoc</category><pubDate>Tue, 07 May 2013 14:35:44 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5407</guid><comments>http://caml.inria.fr/mantis/view.php?id=5407#bugnotes</comments></item><item><title>0006008: Document the behaviour of #4915</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6008</link><description><![CDATA[The manual doesn't document the {%backend: %} directive.]]></description><category>OCamldoc</category><pubDate>Tue, 07 May 2013 11:01:58 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6008</guid><comments>http://caml.inria.fr/mantis/view.php?id=6008#bugnotes</comments></item><item><title>0006007: Type-checker rejects cyclic type abbreviation even though -rectypes is activated</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6007</link><description><![CDATA[This problem concerns ocamlc -rectypes. If I define a cyclic type&lt;br /&gt;
abbreviation foo as follows, it is accepted:&lt;br /&gt;
&lt;br /&gt;
type 'a foo = 'a foo list (* accepted *)&lt;br /&gt;
&lt;br /&gt;
However, I wish to abstract away the type list, so I place this&lt;br /&gt;
definition in the body of a functor, which expects list as an&lt;br /&gt;
argument. Then, the definition is rejected by ocaml 4.00.1:&lt;br /&gt;
&lt;br /&gt;
module M (X : sig type 'a list end) = struct&lt;br /&gt;
  type 'a foo = 'a foo X.list&lt;br /&gt;
  (* accepted by ocaml 3.11.2; rejected by ocaml 4.00.1 *)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Is this a bug or is there a good reason to reject this definition?&lt;br /&gt;
Thanks!&lt;br /&gt;
Francois.]]></description><category>OCaml typing</category><pubDate>Mon, 06 May 2013 14:28:37 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6007</guid><comments>http://caml.inria.fr/mantis/view.php?id=6007#bugnotes</comments></item><item><title>0005343: ocaml -rectypes is unsound wrt module subtyping</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5343</link><description><![CDATA[The following example should not be accepted...&lt;br /&gt;
&lt;br /&gt;
module M : sig&lt;br /&gt;
  type 'a t&lt;br /&gt;
  type u = u t and v = v t&lt;br /&gt;
  val f : int -&gt; u&lt;br /&gt;
  val g : v -&gt; bool&lt;br /&gt;
end = struct&lt;br /&gt;
  type 'a t = 'a&lt;br /&gt;
  type u = int and v = bool&lt;br /&gt;
  let f x = x&lt;br /&gt;
  let g x = x&lt;br /&gt;
end;;&lt;br /&gt;
&lt;br /&gt;
# let h x = M.g (M.f x);;&lt;br /&gt;
val h : int -&gt; bool = &lt;fun&gt;&lt;br /&gt;
# h 3;;&lt;br /&gt;
- : bool = &lt;unknown constructor&gt;]]></description><category>OCaml general</category><pubDate>Mon, 06 May 2013 11:35:12 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5343</guid><comments>http://caml.inria.fr/mantis/view.php?id=5343#bugnotes</comments></item><item><title>0006004: Type information does not flow to "inherit" parameters</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6004</link><description><![CDATA[If we compile the following with -principal:&lt;br /&gt;
&lt;br /&gt;
======================================================================&lt;br /&gt;
type t = A&lt;br /&gt;
type s = A&lt;br /&gt;
&lt;br /&gt;
class f (_ : t) = object end&lt;br /&gt;
&lt;br /&gt;
let _ = new f A  (* ok *)&lt;br /&gt;
&lt;br /&gt;
class g = object&lt;br /&gt;
  inherit f A  (* -&gt; this type-based constructor disambiguation is not principal. *)&lt;br /&gt;
end&lt;br /&gt;
======================================================================&lt;br /&gt;
&lt;br /&gt;
we get a warning 18, but only on the second occurrence of &quot;f A&quot;.  Is it normal?]]></description><category>OCaml typing</category><pubDate>Sat, 04 May 2013 03:45:17 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6004</guid><comments>http://caml.inria.fr/mantis/view.php?id=6004#bugnotes</comments></item><item><title>0006005: Obj.magic with recursive modules</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6005</link><description><![CDATA[It seems that consistency of module type constraints is not checked. It is then possible to write Obj.magic by converting a module type to an implementation:&lt;br /&gt;
&lt;br /&gt;
let magic : type a b. a -&gt; b = fun x -&gt;&lt;br /&gt;
  let module M = struct&lt;br /&gt;
    module type A = sig type t = X of a end&lt;br /&gt;
    type u = X of b&lt;br /&gt;
    module type B = A with type t = u&lt;br /&gt;
    module rec M : B = M&lt;br /&gt;
  end in&lt;br /&gt;
  let M.X x = M.M.X x in&lt;br /&gt;
  x]]></description><category>OCaml typing</category><pubDate>Fri, 03 May 2013 16:41:40 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6005</guid><comments>http://caml.inria.fr/mantis/view.php?id=6005#bugnotes</comments></item><item><title>0006002: An easier way to avoid elided printing of values</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6002</link><description><![CDATA[A minor thing, this.&lt;br /&gt;
&lt;br /&gt;
We have #print_depth and #print_length but one has to choose arbitrary values like 1000 to give to them (can't even use max_int because it's in a directive).&lt;br /&gt;
&lt;br /&gt;
It would be nice to either hack the parser to allow max_int as a 'token' within integer-argumented directives, or alternatively add #print_all as a directive asking OCaml to never elide the output in any way (in other words, to ignore the values of print_length and print_depth).]]></description><category>OCaml general</category><pubDate>Thu, 02 May 2013 13:34:35 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6002</guid><comments>http://caml.inria.fr/mantis/view.php?id=6002#bugnotes</comments></item><item><title>0006003: simple references sometimes slow</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=6003</link><description><![CDATA[The following two code samples show inefficiency in dealing with references.&lt;br /&gt;
&lt;br /&gt;
I believe that the first example is more likely to appear in a real world code.  I have a feeling that it may not be hard to fix.&lt;br /&gt;
&lt;br /&gt;
The second example is more synthetic.  I understand the reason and I don't have a clear idea how it could be solved.]]></description><category>OCaml backend (code generation)</category><pubDate>Wed, 01 May 2013 15:20:10 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=6003</guid><comments>http://caml.inria.fr/mantis/view.php?id=6003#bugnotes</comments></item><item><title>0005985: Unexpected interaction between variance and GADTs</title><author></author><link>http://caml.inria.fr/mantis/view.php?id=5985</link><description><![CDATA[The following program&lt;br /&gt;
&lt;br /&gt;
   type _ t = T : 'a -&gt; 'a s t&lt;br /&gt;
&lt;br /&gt;
is accepted if s is covariant (e.g. type 'a s = 'a), contravariant (e.g. type 'a s = 'a -&gt; unit) or invariant (e.g. type 'a s = 'a -&gt; 'a), but rejected if s is &quot;bivariant&quot; (e.g. type 'a s = int):&lt;br /&gt;
&lt;br /&gt;
    # type 'a s = int;;&lt;br /&gt;
    type 'a s = int&lt;br /&gt;
    # type _ t = T : 'a -&gt; 'a s t ;;&lt;br /&gt;
    Characters 4-27:&lt;br /&gt;
      type _ t = T : 'a -&gt; 'a s t ;;&lt;br /&gt;
          ^^^^^^^^^^^^^^^^^^^^^^^&lt;br /&gt;
    Error: In this definition, a type variable has a variance that&lt;br /&gt;
           is not reflected by its occurrence in type parameters.&lt;br /&gt;
&lt;br /&gt;
However, if s is abstracted then the program is accepted, even if s is instantiated with a bivariant constructor:&lt;br /&gt;
&lt;br /&gt;
    # include&lt;br /&gt;
      (functor (S : sig type 'a s end) -&gt;&lt;br /&gt;
        struct&lt;br /&gt;
          include S&lt;br /&gt;
          type _ t = T : 'a -&gt; 'a s t&lt;br /&gt;
        end)&lt;br /&gt;
        (struct type 'a s = int end)&lt;br /&gt;
    ;;&lt;br /&gt;
    type 'a s = int&lt;br /&gt;
    type _ t = T : 'a -&gt; 'a s t&lt;br /&gt;
    #]]></description><category>OCaml typing</category><pubDate>Tue, 30 Apr 2013 07:29:51 +0200</pubDate><guid>http://caml.inria.fr/mantis/view.php?id=5985</guid><comments>http://caml.inria.fr/mantis/view.php?id=5985#bugnotes</comments></item></channel></rss>
