caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] namespace inside object?
@ 2017-02-09 20:36 Steffen Smolka
  2017-02-09 22:55 ` Jeremy Yallop
  0 siblings, 1 reply; 12+ messages in thread
From: Steffen Smolka @ 2017-02-09 20:36 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

Is it possible to create namespaces inside an object? Concretely, I would
like to write

class buffer = object(self)
  ...
  method get = ...

  module Latin1 = struct
    method get = ...
  end

  module Utf8 = struct
    method get = ...
  end
end

so that given an object b : buffer, I can call methods
b#get
b#Latin1.get
b#Utf8.get

Declaring modules inside an object seems to be illegal, though. Is there
any way to achieve something along those lines? Is there a better way to
structure things?

Thanks,
-- Steffen

[-- Attachment #2: Type: text/html, Size: 807 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-02-10 15:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 20:36 [Caml-list] namespace inside object? Steffen Smolka
2017-02-09 22:55 ` Jeremy Yallop
2017-02-09 23:19   ` Steffen Smolka
2017-02-09 23:37     ` Gerd Stolpmann
2017-02-09 23:54       ` Steffen Smolka
2017-02-10  2:01         ` Yaron Minsky
2017-02-10  3:16           ` Steffen Smolka
2017-02-10  3:32             ` Yaron Minsky
2017-02-10  9:38             ` Leo White
2017-02-10 14:40               ` Evgeny Roubinchtein
2017-02-10 15:16                 ` Markus Mottl
2017-02-10 15:49                 ` Leo White

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).