[m-rev.] for review: std_util__arg_name

Michael Day mikeday at bigpond.net.au
Fri Sep 28 13:59:59 AEST 2001


> No, it needs a log message and it needs to be tested before it is
> committed.

Oops. I already committed it with the following log message:

----
Estimated hours taken: 4
Branches: main

Adding get_functor/6 which returns a list of the functor argument names (if
any) as well as types.
----

After testing with the program below:

----
:- module test.

:- interface.

:- import_module io.

:- pred main(io, io).
:- mode main(di, uo) is det.

:- implementation.

:- import_module string, std_util, list.

:- type foo
    --->    foo(first :: string, string, third :: string).

main -->
    ( if { get_functor(type_of(foo("a", "b", "c")), 0, _, _, Types, Names)
} then
        write(Types), nl,
        write(Names), nl
    ).
----

which produced the following output:

[string, string, string]
[yes("first"), no, yes("third")]

which appears to be correct. I didn't test it on tuples or ints or other
types though. Shall I back out the change?

Sorry,

Michael

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