caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] CamlIdl possible issue
@ 2004-08-16 19:46 Shishir Ramam
  2004-08-16 21:28 ` Matthieu Dubuget
  0 siblings, 1 reply; 3+ messages in thread
From: Shishir Ramam @ 2004-08-16 19:46 UTC (permalink / raw)
  To: caml list

Hi,
I am trying to use CamlIdl (Ocaml 3.07+2 win32) and have this case in which 
I understand what is happening, not sure why it  has been implemented thus. 

For the following structure, when SOME_VAR is *not* defined, 
---
struct my_test {
	int x;
#ifdef SOME_VAR
	int y;
#endif
};
---

CamlIdl converts this to 
---
let my_test = int
---

This is because a structure with one element is getting special attention in 
Struct.ml_declaration. 

Knowing very little about the MIDL specification, I attempted to run this 
against a MIDL compiler for the following result -
---
struct  my_test
    {
    int x;
    };
---

It seems that the special casing of the single element is not the best of
things for my application, since any reference to the element x will have to be
modified in the Ocaml program depending on whether SOME_VAR is defined or not. 

IMHO this seems like a bug. Was wondering if there is some other explanation 
for this.

Thanks in advance for any help.
-shishir

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] CamlIdl possible issue
  2004-08-16 19:46 [Caml-list] CamlIdl possible issue Shishir Ramam
@ 2004-08-16 21:28 ` Matthieu Dubuget
  2004-08-16 23:04   ` Shishir Ramam
  0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Dubuget @ 2004-08-16 21:28 UTC (permalink / raw)
  To: caml list; +Cc: Shishir Ramam

Shishir Ramam a écrit :
> It seems that the special casing of the single element is not the best of
> things for my application, since any reference to the element x will have to be
> modified in the Ocaml program depending on whether SOME_VAR is defined or not. 
> 
> IMHO this seems like a bug. Was wondering if there is some other explanation 
> for this.

According to the documentation, this is a design choice.

> 
> Thanks in advance for any help.

If this problem appears not two often you can avoid it by adding your 
own ml2c and c2ml functions using the attributes ml2c and c2ml.

I hope this helps.

Salutations

Matthieu Dubuget

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] CamlIdl possible issue
  2004-08-16 21:28 ` Matthieu Dubuget
@ 2004-08-16 23:04   ` Shishir Ramam
  0 siblings, 0 replies; 3+ messages in thread
From: Shishir Ramam @ 2004-08-16 23:04 UTC (permalink / raw)
  To: caml list

Matthieu,
Thanks for the quick response. 

> If this problem appears not two often you can avoid it by adding your
> own ml2c and c2ml functions using the attributes ml2c and c2ml.

That is exactly what I have done. 

Was wondering if there's any chance I can influence a change in the 
design for this case.

regards,
-shishir

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2004-08-16 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 19:46 [Caml-list] CamlIdl possible issue Shishir Ramam
2004-08-16 21:28 ` Matthieu Dubuget
2004-08-16 23:04   ` Shishir Ramam

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).