[mercury-users] partial instantiation?

Tomas By tomas at basun.net
Mon Apr 19 17:28:39 AEST 2010


On Mon, April 19, 2010 09:22, Tomas By wrote:
> On Mon, April 19, 2010 03:13, Ralph Becket wrote:
>> You can then do things like
>>
>> 	cmd("command", [str("filename")], Cmd1),
>> 	cmd("command", [int(N)], Cmd2),
>> 	...
>
> Hmm - does this work though? Can "[int(N)]" be just "in"?

Sorry - I misunderstood. You mean that N is instantiated to something.

Well, the way I was thinking was that I would not know if a particular
parameter was a string or an integer, but just collect all possibilities
and then report error if it was not exactly one.

Also, the way you have written it, the parameters are not passed to the
commands.

Anyway, I have started changing it to a more complicated command type
where the optional arguments are expressed by constructors and then
anti-curried into the commands.

/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