[m-rev.] diff: fix io__command_line_arguments in il grade
Peter Ross
pro at missioncriticalit.com
Fri Nov 29 03:42:26 AEDT 2002
On Fri, Nov 29, 2002 at 01:17:10AM +1100, Fergus Henderson wrote:
> On 28-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > +++ runtime/mercury_mcpp.h 28 Nov 2002 11:14:57 -0000
> > @@ -219,6 +219,13 @@
> > // Note that this is very dependent on the data representation chosen
> > // by the compiler.
> >
> > +#ifdef MR_HIGHLEVEL_DATA
> > +#define MR_list_nil(List) \
> > + List = mercury::list::mercury_code::ML_empty_list(NULL)
> > +
> > +#define MR_list_cons(List, Head, Tail) \
> > + List = mercury::list::mercury_code::ML_cons(NULL, Head, Tail)
> > +#else
> > #define MR_list_cons(List, Head, Tail) \
> > do { \
> > MR_Word _tmp; \
>
> The #defines here inside the #ifdef should be intended two spaces.
>
> > +++ library/list.m 28 Nov 2002 11:14:59 -0000
> > +:- func empty_list = list(T).
> > +:- pragma export(empty_list = out, "ML_empty_list").
> > +empty_list = [].
> > +
> > +:- func cons(T, list(T)) = list(T).
> > +:- pragma export((cons(in, in) = (out)), "ML_cons").
> > +cons(H, T) = [H | T].
>
> A comment saying why they are exported with `pragma export'
> might be helpful here.
>
Estimated hours taken: 0.25
Branches: main
library/list.m:
runtime/mercury_mcpp.h:
Review comments from fjh for my previous change.
Index: library/list.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/list.m,v
retrieving revision 1.109
diff -u -r1.109 list.m
--- library/list.m 28 Nov 2002 11:21:45 -0000 1.109
+++ library/list.m 28 Nov 2002 16:39:37 -0000
@@ -1519,6 +1519,11 @@
%-----------------------------------------------------------------------------%
+%
+% These functions are exported so that they can be used instead of the
+% names [|]_2 and []_0. These two names can be difficult to use from other
+% managed languages on the il backend.
+%
:- func empty_list = list(T).
:- pragma export(empty_list = out, "ML_empty_list").
empty_list = [].
Index: runtime/mercury_mcpp.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_mcpp.h,v
retrieving revision 1.23
diff -u -r1.23 mercury_mcpp.h
--- runtime/mercury_mcpp.h 28 Nov 2002 11:21:42 -0000 1.23
+++ runtime/mercury_mcpp.h 28 Nov 2002 16:39:37 -0000
@@ -220,13 +220,13 @@
// by the compiler.
#ifdef MR_HIGHLEVEL_DATA
-#define MR_list_nil(List) \
+ #define MR_list_nil(List) \
List = mercury::list::mercury_code::ML_empty_list(NULL)
-#define MR_list_cons(List, Head, Tail) \
+ #define MR_list_cons(List, Head, Tail) \
List = mercury::list::mercury_code::ML_cons(NULL, Head, Tail)
#else
-#define MR_list_cons(List, Head, Tail) \
+ #define MR_list_cons(List, Head, Tail) \
do { \
MR_Word _tmp; \
MR_newobj((_tmp), 1, 2); \
@@ -235,7 +235,7 @@
List = _tmp; \
} while (0)
-#define MR_list_nil(List) \
+ #define MR_list_nil(List) \
MR_newobj(List, 0, 0);
#endif
--------------------------------------------------------------------------
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