Created
August 22, 2008 21:08
-
-
Save jeremyBanks/6853 to your computer and use it in GitHub Desktop.
[2010-01] really noob sbcl, I guess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sbclx | |
; I'd like to do this with map/reduce stuff, | |
; but I'll not get ahead of myself yet. | |
(let | |
((sum 0)) | |
(do | |
( | |
(i 1 (1+ i)) | |
(limit 1000) | |
) | |
((>= i limit)) | |
(if | |
(or ; condition | |
(= 0 | |
(mod i 5) | |
) | |
(= 0 | |
(mod i 3) | |
) | |
) | |
(setq sum (+ sum i)) ; if true | |
; if false (nothing) | |
) | |
) | |
( | |
print sum | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment