[mercury-users] partial instantiation?

Tomas By tomas at basun.net
Wed Apr 14 14:13:40 AEST 2010


On Wed, April 14, 2010 05:52, Paul Bone wrote:
> On Wed, Apr 14, 2010 at 05:38:04AM +0200, Tomas By wrote:
>> |cmd( "command", [],              dosomething(0,"filename") ).
>> |cmd( "command", [str(F)],        dosomething(0,F)          ).
>> |cmd( "command", [int(N)],        dosomething(N,"filename") ).
>> |cmd( "command", [str(F),int(N)], dosomething(N,F)          ).
>
> Now that I look more closely in some cases (of cmd/3) you are fully
> instantiating the 2nd and 3rd arguments, and it other cases you are only
> using partial instantiation.  You need to use either one or the other in
> _all_ cases.

rite...

> Try to work out why you _need_ partial instantiation.  If you can't find
> a good reason then you don't need it :-).

Well, it's for making the list of commands nice and simple. The parameters
are optional, so I need there to be sometimes values and sometimes free
variables.

> I also suspect that you think that Mercury supports logic variables, it
> does not.

No, I am aware of that. I do not need aliasing (or whatever the technical
term is).

/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