My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; returns a list containing `n` copies of `x`
(define duple
(lambda (n x)
(if (zero? n)
()
(cons x (duple (- n 1) x)))))



(duple 2 3)
; (3 3)

(duple 4 '(ho ho))
; ((ho ho) (ho ho) (ho ho) (ho ho))

(duple 0 '(blah))
; ()

Change log

r2 by jonathan.hefner on Jun 8, 2008   Diff
Initial commit
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 263 bytes, 17 lines
Powered by Google Project Hosting