[m-dev.] for review: pragma foreign_code for MC++ (part 2/2)

Tyson Dowd trd at cs.mu.OZ.AU
Fri Nov 17 05:55:33 AEDT 2000


On 16-Nov-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 16-Nov-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > @@ -215,7 +235,7 @@
> >  		% which means that for Mercury functions the Mercury return
> >  		% value becomes the last argument, and the C return value
> >  		% is a bool that is used to indicate success or failure.
> > -		C_Code0 = "SUCCESS_INDICATOR = ",
> > +		C_Code0 = "MR_SUCCESS_INDICATOR = ",
> 
> That is definitely wrong now, and depending on the details of Zoltan's
> change, might still be wrong after his change.
> 
> In fact SUCCESS_INDICATOR is one of the macros that we document in the
> Mercury language reference manual.  So now that I think about it in
> more detail, my guess is that Zoltan probably won't/didn't change it.
> 

Ok.

> > diff -u compiler/intermod.m compiler/intermod.m
> > --- compiler/intermod.m
> > +++ compiler/intermod.m
> > @@ -218,7 +218,7 @@
> >  			intermod_info_get_preds(Preds0),
> >  			( { pred_info_get_goal_type(PredInfo, pragmas) } ->
> >  				% The header code must be written since
> > -				% it could be used by the pragma_foreign_code.
> > +				% it could be used by the pragma_c_code.
> >  				intermod_info_set_write_header
> >  			;
> >  				[]
> 
> That looks wrong, I think.
> At least I don't understand the reason for that change.
> Did you somehow accidentally reverse that?

This appears to be a bug in interdiff.

Somehow it has put the diff around the wrong way for this module.

The other cases are the same.

> >  attributes_to_strings(Attrs, StringList) :-
> > +	% We ingore Lang because it isn't an attribute that you can put
> > +	% in the attribute list -- the foreign language specifier string
> > +	% is at the start of the pragma.
> 
> s/ingore/ignore/
> 
> This should probably be documented in the interface documentation
> for attributes_to_strings.
> 

The comment in the interface now reads:

        % Convert the foreign code attributes to their source code
        % representations suitable for placing in the attributes list of
        % the pragma (not all attributes have one).
        % In particular, the foreign language attribute needs to be
        % handled separately as it belongs at the start of the pragma.

-- 
       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-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list