############################################################################ # # File: binop.icn # # Subject: Procedure to apply binary operation to list of values # # Author: Ralph E. Griswold # # Date: July 15, 1995 # ############################################################################ # # This file is in the public domain. # ############################################################################ # # This procedure applies a binary operation to a list of arguments. # For example, # # binop("+", 1, 2, 3) # # returns 6. # ############################################################################ procedure binop(op, result, rest[]) #: apply binary operation every result := op(result, !rest) return result end