Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007786OCamlstandard librarypublic2018-04-26 18:482018-04-30 19:14
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007786: Add bigarray literals?
DescriptionNow that Bigarray is part of the stdlib, I am wondering if we should introduce bigarray literals.

As delimiter the most logical syntax would be {| 1; 2; 3 |}, but that is already taken, so we need an alternative.

Since the bigarray type cannot be deduced from the OCaml type of its elements (e.g. the above bigarray could be of type int8_signed_int or int16_unsigned_int or ...), we also need an optional syntax to specify a concrete bigarray type.

There is also the issue of the empty bigarray: for it, we must always specify the concrete bigarray type since we cannot give it a fully general type ('a, 'b, 'c) Bigarray.Genarray.t.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
hcarty (reporter)
2018-04-26 21:44

A first pass at this could use extension point syntax, along the lines of:

[%bigarray int8_unsigned c_layout {1; 2; 3}]

[%bigarray char c_layout "I'm a bigstring"]
nholland94 (reporter)
2018-04-29 23:19

A syntax like what you describe is already available as a ppx package. [^]

This is really a question of whether or not a new type of literal should be added to the language.
hcarty (reporter)
2018-04-30 19:14

Indeed - my comment was only meant to suggest that a final sugared syntax may not be necessary right away since there are internal changes to go along with this.

- Issue History
Date Modified Username Field Change
2018-04-26 18:48 nojebar New Issue
2018-04-26 21:44 hcarty Note Added: 0019065
2018-04-29 23:19 nholland94 Note Added: 0019081
2018-04-30 19:14 hcarty Note Added: 0019082

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker