[m-rev.] diff: use MR_Bool instead of bool.

Tyson Dowd trd at cs.mu.OZ.AU
Wed May 9 21:06:04 AEST 2001


On 09-May-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 09-May-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > compiler/ml_code_gen.m:
> > 	Generate foreign language code using MR_Bool instead of bool.
> > 	MC++ doesn't like us using "bool" (not if we want to use the
> > 	namespace "bool" as well, anyway).  And we should use the
> > 	typedef in mercury_types.h instead anyway.
> 
> That patch is fine.  But I'm not sure that it solves the problem with
> namespace bool.   "bool" is a C++ keyword, so "namespace bool" is a
> syntax error.

Right. 

I am currently generating some code that does #using "bool.dll" (which
contains a namespace mercury.bool).

If I don't do that it doesn't get confused about bool.

It's because it's inside namspace mercury, and there is a namespace
bool inside that namespace.  

#using <mscorlib.dll>
#using "bool.dll"
namespace mercury {
void foo(void) {
        bool i;
}
}


The strange thing is if you use
 	using namespace mercury;
instead of being inside the mercury namespace, you get a resonable error
message.  And if bool is a top-level namespace, you get no error message
at all.

> For CLS compliance, MC++ is supposed to have some way of escaping they
> keyword, but I think last time I looked it didn't.

I agree.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list