# $Id: sumcol.pliant,v 1.0 2002/02/08 12:07:00 dada Exp $ # http://dada.perl.it/shootout/ module "/pliant/language/context.pli" module "/pliant/language/stream.pli" module "/pliant/language/stream/pipe.pli" gvar Str line := "" (gvar Stream STDIN) open "handle:0" in gvar uInt sum := 0 gvar Int i while (STDIN atend) = false line := STDIN readline i := 0 if(line parse i any) sum := sum + i console sum eol