(Frédéric Bour)
Typechecking of nonrec types was still looking for uses in the temporary environment.
This made the compiler fail with "exception Not_found" when warning 34 was enabled.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(Vladimir Brankov)
bigarray_indexing now works the same way indexing ordinary arrays works.
Review note: the local ba_indexing function now returns a tagged
integer instead of an untagged integer.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16046 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Currently it is not equivalent to do:
cd testsuite; make one DIR=tests/$foo
and
cd testsuite/tests/$foo; make
because the latter will not set TERM=dumb and toplevel tests will use
nice escape-code location highlighting instead of ASCII-made squiggly
lines, which breaks the tests.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
This commits modify the Bigarray syntax extension in order to facilitate the use of custom .{} operators. The compatibility with the existing Bigarray syntax has been preserved as much as possible. However, this commit will break code which use the Bigarray .{}
syntax without opening the Bigarray module first!
Like the previous commit, this commit modifies the parser to desugar bigarray1.{index} to ( .{} ) bigarray1 index. Following the bigarray syntax, the index operator used
in the desugaring changes if the index is a n-tuple:
1-tuple => .{}
2-tuple => .{,}
3-tuple => .{,,}
4 and more tuples => .{,..,}
The bigarray modules has been modified to use this new index operators. Note that this means that these index operators are not anymore accessible without opening the bigarray module.
From: octachron <octa@polychoron.fr>
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
and unshared default clauses in the presence of many (>= 32) non-matched
constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15570 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
- Register type "Addr" is split into
. "Val" (well-formed OCaml values, appropriate as GC roots)
. "Addr" (derived pointers within the heap, must not survive a GC)
- memory_chunk "Word" is split into
. "Word_val" (OCaml value)
. "Word_int" (native-sized integer, not a pointer into the heap)
Cmmgen was updated to use Word_val or Word_int as appropriate.
Application #1: fail at compile-time if a derived pointer within the heap
survives a GC point (cf. PR#6484).
Application #2: CSE can do a better job across allocation points
(keep factoring expressions of type Int, Val, Float, but not Addr).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cmm-mach-types@15568 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
During closure conversion, the right-hand side of a functional binding in a
recursive binding group is now always closed as a named expression rather than
an anonymous expression. As a result, direct recursive calls do not need to
retrieve their target from a closure environment. This does not only result in
more efficient code being generated, but also avoids a potential blocker for
successful tail-call detection during pseudo-instruction selection.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14966 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
This should make the type-checking of formats simpler and more robust:
instead of trying to find a pair as previously, we can now use the
path of the format6 type directly.
A nice side-effect of the change is that the internal definition of
formats (as a pair) is not printed in error messages anymore.
Because format6 is in fact defined in the CamlinternalFormatBasics
submodule of Pervasives, and has an alias at the toplevel of
Pervasives, error messages still expand the definition:
> Error: This expression has type
> ('a, 'b, 'c, 'd, 'd, 'a) format6 =
> ('a, 'b, 'c, 'd, 'd, 'a) CamlinternalFormatBasics.format6
> but an expression was expected of type ...
Passing the option `-short-paths` does avoid this expansion and
returns exactly the same error message as 4.01:
> Error: This expression has type ('a, 'b, 'c, 'd, 'd, 'a) format6
> but an expression was expected of type ...
(To get this error message without -short-paths, one would need to
define format6 directly in Pervasives; but this type is mutually
recursive with several GADT types that we don't want to add in the
Pervasives namespace unqualified. This is why I'll keep the alias
for now.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14868 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Contrarily to the previous commit, this change is *not* completely
benine: it corresponds to the fact that Jacques' trunk@14523 (a
principality warning on formats in some situation) has not yet been
replayed on the format-gadts branch -- I mainly focused on backward
compatiblity.
The plan is to replay this change really soon, *after* converting
format6 to a nominal datatype -- this will much simplify the
re-implementation of the warning in the type-checker.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14847 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
The change is benine: currently, error messages about format6 also
give its definition as a product of an inner format and a string: the
message changes, but the semantics is the same.
Ultimately, we want the error message *not* to change (we don't want
the internal implementation of formats to be exposed to the innocent
user), and that will be achieved by converting format6 to a nominal
type instead of a structural pair.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14846 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(printf {%foo%} bar) will print the string representation of the
format type of both `foo` and `bar`, instead of printing `bar`
(for this purpose one can just use %s). `bar` content is ignored, but
the typer should check that its type is compatible with the one of
`foo`.
This semantics allows to use (printf %{..%}) for testing/debugging the
use of %(...%): put in the brackets what you believe to be the format
type you want to use, and as argument the format you wish to pass, and
you'll get type-checking confidence and the "canonical" representation
of the format string which you can use in the %(...%) -- note that
using the canonical format type is not mandatory.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14840 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
To finish the bootstrap cycle, run:
make library-cross
make promote
make partialclean
make core
make library-cross
make promote-cross
make partialclean
make ocamlc ocamllex ocamltools
make library-cross
make promote
make partialclean
make core
make compare
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
- The internal [backtrace_slot] type is not exposed anymore, instead
accessors function return orthogonal information
(is_raise, location). This is both more extensible and more
user-friendly.
- The [raw_backtrace_slot] is exposed separately as a low-level type
that most users should never use. The unsafety of marshalling is
documented. Instead of defining
[raw_backtrace = raw_backtrace_slot array], I kept [raw_backtrace]
an abstract type with [length] and [get] functions for
random-access. This should allow us to change the implementation in
the future to be more robust wrt. marshalling (boxing the trace in
a Custom block, or even possibly the raw slots at access time).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02