public
Description: An easy way to make web apps (in PLT Scheme)
Homepage: http://blog.leftparen.com
Clone URL: git://github.com/vegashacker/leftparen.git
Click here to lend your support to: leftparen and make a donation at www.pledgie.com !
leftparen / compute.scm
100644 17 lines (12 sloc) 0.247 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#lang scheme/base
 
;; record computations
 
(require "record.scm"
         "util.scm")
 
(provide
 sum-recs
 )
 
(define (sum-recs recs prop-to-sum)
  (foldl (lambda (rec acc)
           (+ acc (rec-prop rec prop-to-sum)))
         0
         recs))