Skip to content

Instantly share code, notes, and snippets.

@jeremyBanks
Created August 22, 2008 21:08
Show Gist options
  • Save jeremyBanks/6853 to your computer and use it in GitHub Desktop.
Save jeremyBanks/6853 to your computer and use it in GitHub Desktop.
[2010-01] really noob sbcl, I guess
#!/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