[mercury-users] partial instantiation?

Tomas By tomas at basun.net
Wed Apr 21 17:25:40 AEST 2010


On Tue, April 20, 2010 09:12, Mark Brown wrote:
> On 20-Apr-2010, Tomas By <tomas at basun.net> wrote:
>> If I want the types of the arguments to
>> be a factor when picking the right command, and to be able to accept
>> strings consisting of only digits for some commands, then this doesn't
>> work.
>
> Yes it does:
>
>     cmd_handler(cmd3, [Arg1], handler(N)) :-
>        string.to_int(Arg1, N).   % fails if Arg1 is not an integer

Hmm, yes, that's a good suggestion. One extra procedure call on some
lines is something I can live with I think, so now I can use in/in/out.

Thanks for pointing out the obvious! One needs somebody to do that
sometimes.

/Tomas


--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list