* [Caml-list] opening a module within a class definition
@ 2017-02-09 1:57 Martin DeMello
2017-02-09 6:47 ` François Pottier
0 siblings, 1 reply; 3+ messages in thread
From: Martin DeMello @ 2017-02-09 1:57 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 118 bytes --]
Is this possible? I couldn't find the right syntax to do it if so.
class foo =
let open My_module in
...
martin
[-- Attachment #2: Type: text/html, Size: 378 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] opening a module within a class definition
2017-02-09 1:57 [Caml-list] opening a module within a class definition Martin DeMello
@ 2017-02-09 6:47 ` François Pottier
2017-02-09 10:04 ` Martin DeMello
0 siblings, 1 reply; 3+ messages in thread
From: François Pottier @ 2017-02-09 6:47 UTC (permalink / raw)
To: caml-list
Le 09/02/2017 02:57, Martin DeMello a écrit :
> Is this possible? I couldn't find the right syntax to do it if so.
I don't think so. The best workaround I can think of is to wrap
your class in an "include struct", like this:
include struct
open My_module
class foo =
...
end
end
I hope this helps,
--
François Pottier
francois.pottier@inria.fr
http://gallium.inria.fr/~fpottier/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] opening a module within a class definition
2017-02-09 6:47 ` François Pottier
@ 2017-02-09 10:04 ` Martin DeMello
0 siblings, 0 replies; 3+ messages in thread
From: Martin DeMello @ 2017-02-09 10:04 UTC (permalink / raw)
To: François Pottier; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 828 bytes --]
Thanks, I'll play with that.
martin
On Wed, Feb 8, 2017 at 10:47 PM, François Pottier <francois.pottier@inria.fr
> wrote:
> Le 09/02/2017 02:57, Martin DeMello a écrit :
>
>> Is this possible? I couldn't find the right syntax to do it if so.
>>
>
> I don't think so. The best workaround I can think of is to wrap
> your class in an "include struct", like this:
>
> include struct
> open My_module
> class foo =
> ...
> end
> end
>
> I hope this helps,
>
> --
> François Pottier
> francois.pottier@inria.fr
> http://gallium.inria.fr/~fpottier/
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
[-- Attachment #2: Type: text/html, Size: 1849 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-09 10:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 1:57 [Caml-list] opening a module within a class definition Martin DeMello
2017-02-09 6:47 ` François Pottier
2017-02-09 10:04 ` Martin DeMello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox