Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007786OCamlstandard librarypublic2018-04-26 18:482018-05-25 07:46
Reporternojebar 
Assigned Tonojebar 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionwon't fix 
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.

Opinions?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0019065)
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"]
(0019081)
nholland94 (reporter)
2018-04-29 23:19

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

https://github.com/akabe/ppx_bigarray [^]

This is really a question of whether or not a new type of literal should be added to the language.
(0019082)
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.
(0019131)
xleroy (administrator)
2018-05-21 18:47

My gut feeling is that this will be a complicated piece of syntax with relatively few uses. I'd rather leave this for a PPX.
(0019141)
nojebar (developer)
2018-05-25 07:46

Agreed.

- 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
2018-05-21 18:47 xleroy Note Added: 0019131
2018-05-21 18:47 xleroy Severity minor => feature
2018-05-21 18:47 xleroy Status new => acknowledged
2018-05-25 07:46 nojebar Note Added: 0019141
2018-05-25 07:46 nojebar Status acknowledged => closed
2018-05-25 07:46 nojebar Assigned To => nojebar
2018-05-25 07:46 nojebar Resolution open => won't fix


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker