Search the web
Sign In
New User? Sign Up
ocaml_beginners · Ocaml Beginners
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Abstracting a variant type   Message List  
Reply | Forward Message #11171 of 11550 |
Re: "ocaml_beginners"::[] Re: Abstracting a variant type

Vincent Aravantinos wrote:
> --- In ocaml_beginners@yahoogroups.com, Hugo Ferreira <hmf@...> wrote:
>> What is a nonsense? The use of abstract types or the opening up of the
>> type and implementation details to external users?
>
> I think he is talking about doing both at a time. Which is indeed nonsense.
>
>> On a similar note: I too am interested in this issue due to the need
>> for testing modules. Consider the following:
>>
>> 1. I create two implementations, each conforming to a single interface.
>> 2. These implementations are "plugged-in" for use in another
>> (higher-order) module.
>> 3. However I need to test each implementation before use.
>> Note that due to implementation differences I need to access and
>> check stuff specifically to each implementation. Extending the
>> common interface won't help.
>>
>> Anyone have such issues? Anyone know of a way to deal with this?
>
> I am having the same problem and am thinking of just keeping the black box
tests in their own files as usual: they only access the interface (and thus test
only the interface and the accordance of the implementation to the interface);
and embedding the white box tests in the modules that we want to test.
>
> It seems quite a natural solution but I have not tried it in practice yet.
>

Since I keep my tests in separate files from the module source
this might not be the way to go for me.

H.F.


> V.
>
>
>
> ------------------------------------
>
> Archives up to December 31, 2008 are also downloadable at
http://www.connettivo.net/cntprojects/ocaml_beginners/
> The archives of the very official ocaml list (the seniors' one) can be found
at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo!
Groups Links
>
>
>




Fri Jul 3, 2009 2:03 pm

hugotwo3
Offline Offline
Send Email Send Email

Forward
Message #11171 of 11550 |
Expand Messages Author Sort by Date

Hi list, I have a module with a variant type : module M = struct type t = A of ... | B of ... | C of ... ... end and I would like it to be abstract : module M...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jun 29, 2009
1:58 pm

No one ? It seems to be a rather frequent situation, isn't it ? Maybe my question is not clear enough ?...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jul 3, 2009
7:43 am

Vincent Aravantinos wrote: ... without really looking into your mail, why not something allong: module M: sig type t end = struct type t = A of int | B of...
JM Nunes
jose.manuel.nunes@...
Send Email
Jul 3, 2009
9:11 am

... I would still like to access the structure in some way. But this way should not reveal the data structure. Notice my question is highly informal and I...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jul 3, 2009
9:58 am

... The purpose of an abstract type is to hide how it is implemented. You may want to provide an interface to your type, and the end-users will be tied to it....
citromatik
miguel.pignatelli@...
Send Email
Jul 3, 2009
10:16 am

... What is a nonsense? The use of abstract types or the opening up of the type and implementation details to external users? On a similar note: I too am...
Hugo Ferreira
hugotwo3
Offline Send Email
Jul 3, 2009
10:30 am

... I think he is talking about doing both at a time. Which is indeed nonsense. ... I am having the same problem and am thinking of just keeping the black box...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jul 3, 2009
12:22 pm

... Since I keep my tests in separate files from the module source this might not be the way to go for me. H.F....
Hugo Ferreira
hugotwo3
Offline Send Email
Jul 3, 2009
2:04 pm

... Hash: SHA1 ... For testing and debugging purposes I find it convenient to have some access to raw (unabstracted) types. My solution is for every module to...
Peng Zang
peng.zang@...
Send Email
Jul 3, 2009
2:20 pm

... Nice! Thanks Regards, Hugo F....
Hugo Ferreira
hugotwo3
Offline Send Email
Jul 3, 2009
2:46 pm

... I was not clear, settled this way this is indeed non-sense. But what I meant by "structure" in the quotation was not the "implementation structure". I mean...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jul 3, 2009
12:13 pm

Sorry for the slow response, Vincent. I have been on holiday... ... Yes. That solutions works well when it is suitable. Specifically, when the arguments of the...
Jon Harrop
jon@...
Send Email
Jul 3, 2009
8:27 pm

... tediousness. Do you mean there is some general tool? Can you refer us to any examples? ... [Non-text portions of this message have been removed]...
Ashish Agarwal
ashish_a1975
Offline Send Email
Jul 4, 2009
2:03 am

... Exactly. I could not manage to express it as clear... ... Exactly. That's the solution I first chose, this is of course very general but we lose all the...
Vincent Aravantinos
vincent.arav...
Offline Send Email
Jul 5, 2009
1:27 pm

... Sorry, this is actually wrong now. I forgot to mention that a subtle but enormously important advancement was made in OCaml 3.11. Specifically, you can now...
Jon Harrop
jon@...
Send Email
Jul 5, 2009
2:16 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help