/**************************************************************************** Kalkulon - A programmable calculator for programmers This is an example Kalkulon script. To load from within Kalkulon: Load("examples/scriptname.k") then you can call functions like: funcname() or funcname(arg0, ...) Author: Juergen Holetzeck 2003 - 2007 e-mail: contact@kalkulon.de homepage: www.kalkulon.de ****************************************************************************/ //////////////////////////////////////////////////////////////////////////// // some useful functions for building and manipulating lists // // these functions make use of pure functions // e.g. functions without name of the form '#1+#2' where #i is the ith argument // see examples below // Examples addT(list) = Fold(list, 0, '#1+#2'); multT(list) = Fold(list, 1, '#1*#2'); sqrT(list) = ForEach(list, '#*#'); sqrtT(list) = ForEach(list, 'sqrt(#)'); invT(list) = ForEach(list, '1/#');