Paste: running-sum

Author: huh
Mode: factor
Date: Sat, 26 Mar 2011 15:17:02
Plain Text |
MACRO: running-sum ( -- ) gensym [ 0 swap set ] [ [ [ get + dup ] [ set ] bi ] curry ] bi ;
( scratchpad ) { 1 2 3 } [ running-sum ] each

New Annotation

Summary:
Author:
Mode:
Body: