[m-dev.] Why can't we pass a det pred where cc_multi is expected?

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Jul 6 14:40:50 AEST 2005


On Wed, 6 Jul 2005, Peter Hawkins wrote:

> Hi...
> Ralph Becket wrote:
>
> >Consider
> >
> >This seems odd to me.  Is this deliberate or just an oversight?
> >
> >
> Incidentally, a not entirely unrelated problem was annoying me recently.
> I was writing some command-line argument parsing code like so:
>
> :- type option ---> propagator ; labelling_opt ; allsolns_opt ;
> no_combine_opt.
> :- pred option_default(option::out, option_data::out) is nondet.
> option_default(propagator, string("domain")).
> option_default(labelling_opt, string("ffmaxout")).
> option_default(allsolns_opt, bool(no)).
> option_default(no_combine_opt, bool(no)).
>
> In the main predicate, I have:
>     getopt.process_options(
>         option_ops(short_option, long_option, option_default),

That line should probably be:

	  option_ops_multi(short_option, long_option, option_default)

and option_default/2 should be multi.  I believe that's what the
big error message is trying to tell you ;-)

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