Re: [eclipse-clp-users] my own sum

From: Kish Shen <kisshen_at_cisco.com>
Date: Tue, 24 Aug 2010 14:19:30 +0100
Bogdan Tanasa wrote:

> I would like to define  a predicate similar with sum / 2. According to the
> manual :
> 
>  
> 
> call to sum(ExprList, Result) is equivalent to Result is sum(ExprList)
> 
>  
> 
> How can I do that ?
> 

Hi Bogdan,

I am not quite sure I understand what exactly you are asking. Are you 
asking how user defined functions can work in an expression?

The answer to that is ECLiPSe expressions allow any user defined 
predicate  to be part of the expression, with the last argument being 
used as the result of the function, i.e.

foo(X,Y,Res) where Res returns a number can be written in an expression
as  Res is foo(X,Y).

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Tue Aug 24 2010 - 13:19:42 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET