Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > cd14cddf3b3ceaf1193157472227757a > files > 840

parrot-doc-1.6.0-1mdv2010.0.i586.rpm

#!./parrot
# Copyright (C) 2005-2009, Parrot Foundation.
# $Id: sumcol.pir 38369 2009-04-26 12:57:09Z fperrad $
#
# ./parrot -R jit sumcol.pir < sum8M
# by Joshua Isom
# N.B. it is called the sum-file benchmark on the computer shootout (KF)

.sub main :main
	.local pmc stdin
	.local string line
	.local int count, tmp, linelen
	count = 0
	stdin = getstdin
beginwhile:
	line = readline stdin
	linelen = length line
	unless linelen goto endwhile
	tmp	= line
	count += tmp
	goto beginwhile
endwhile:
	print count
	print "\n"
.end


# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: