Skip to content

User-defined indexing operators: bigarray deprecated warning#339

Merged
gasche merged 4 commits intoocaml:user-defined-indexing-operatorsfrom
Octachron:bigarray_deprecated_warning
Dec 8, 2015
Merged

User-defined indexing operators: bigarray deprecated warning#339
gasche merged 4 commits intoocaml:user-defined-indexing-operatorsfrom
Octachron:bigarray_deprecated_warning

Conversation

@Octachron
Copy link
Copy Markdown
Member

The aim of this commit is to preserve source compatibility between the user-defined indexing operators and the main branch when using the Bigarray library.

On the one hand, the user-defined indexing operators branch require to explicitly bring in scope the Bigarray.( .{...} ) before using them. On the other hand, in the main branch, these operators always implicitly refer to the Bigarray module.

In order to bridge the gap between these two different behaviors, this pull request introduces a temporary hack to allow implicit uses of the Bigarray.( .{...} ) index operators in the user-defined indexing operators branch. However, these implicit uses of Bigarray.( .{...} ) operator trigger a deprecated warning (in the user-defined branch).

This warning can be avoided by explicitly bringing in scope the corresponding Bigarray.( .{...} ) operator; for instance by opening either the Bigarray module or the Bigarray.Operators module.

With the simplification of index operators, the expressions a.{..} are
no longer automatically resolved to Bigarray.Array[n].[g|s]et. To use
these operators, it is now necessary to bring them in scope, for
instance by opening either the Bigarray or Bigarray.Operators module.
To ease the transition period, this patch add an hack in
`typing/typetexp.ml` to catch the cases where the index operators
`.{}/.{,}..` are used without being bound in the current scope
and tranlate then to Bigarray.(..)  with a deprecated warning.
This commit update the documentation on the compatibility problems
between the deprecated bigarray specific syntax extension and the new
user-defined index operators extension. In particular, this commit
describes the new deprecated warning for implicit use of the
`Bigarray(.{...})` operators and states that this warning might be
turned into an error in the undetermined futures. This commits also
amend the documentation to mention the new `Bigarray.Operators`
submodule when useful.
Change the name from customizable to user-defined index operators and
fix the alignment of the latex tables for better readability.
@gasche
Copy link
Copy Markdown
Member

gasche commented Dec 8, 2015

Excellent pull request, mergeable as is. Thanks!

gasche added a commit that referenced this pull request Dec 8, 2015
User-defined indexing operators: bigarray deprecated warning
@gasche gasche merged commit 969ec04 into ocaml:user-defined-indexing-operators Dec 8, 2015
poechsel pushed a commit to poechsel/ocaml that referenced this pull request Apr 1, 2021
chambart pushed a commit to chambart/ocaml-1 that referenced this pull request Jan 4, 2022
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Tweaks the menu text for the first two columns as well, still
working on the third one.

Closes ocaml#339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants