|Anonymous | Login | Signup for a new account||2015-03-27 14:20 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006271||OCaml||OCaml general||public||2013-12-14 12:14||2014-07-16 14:49|
|Target Version||Fixed in Version|
|Summary||0006271: 'let open' in class expressions|
|Description||It'd be useful to have 'let open' available in class expressions:|
class c =
let open M in
object ... end
|Tags||No tags attached.|
Note that the following achieves the same effect:
class c = object
Thanks, Alain! That's a useful workaround, and adequate for my use case.
There are a few other benefits in allowing 'let open' in class expressions. For one thing, there's a pleasing uniformity about having 'let open ... in' available everywhere that 'let ... in' is available. It also handles a few cases that the 'include' approach doesn't: for example, it supports recursive classes where you want careful control over the scope. Perhaps these aren't enough to justify its inclusion, though.
Well, "let open" should be simple enough to do, so I'll consider seriously doing it.
Note that on the other hand "let module" would be really difficult.
On a related note, it might be nice to allow open statements within class definitions:
class c = object
|2013-12-14 12:14||yallop||New Issue|
|2013-12-16 10:36||frisch||Note Added: 0010715|
|2013-12-18 00:46||yallop||Note Added: 0010743|
|2013-12-18 02:51||garrigue||Note Added: 0010745|
|2013-12-18 20:37||lpw25||Note Added: 0010751|
|2014-07-16 14:49||doligez||Status||new => acknowledged|
|Copyright © 2000 - 2011 MantisBT Group|