
sum(+ExprList, ?Result)

   Evaluates the the arithmetic expressions in ExprList and unifies their sum
with Result.



Arguments
   +ExprList           A list of arithmetic expressions.
   ?Result             A variable or number.

Type
   Arithmetic

Description
   This predicate is used by the ECLiPSe compiler to expand evaluable
    arithmetic expressions.  So the call to sum(ExprList, Result) is
    equivalent to

    Result is sum(ExprList)

    which should be preferred.

   In coroutining mode, if the list is only partly instantiated, the
   predicate delays until the list is complete.


Resatisfiable
      No

Fail Conditions
      None.



Exceptions
     4 --- ExprList is a partial list (non-coroutining mode only).
     5 --- ExprList is not a proper list.
     5 --- Result is not a number.

Examples
   
Success:
      X is sum([1,2,3]).  % gives X = 6





See Also
   is / 2, + / 3
