Skip to content

Instantly share code, notes, and snippets.

@jasonsperske
Created August 19, 2014 20:46
Show Gist options
  • Save jasonsperske/cb48dfe15cdbd8c4ad9f to your computer and use it in GitHub Desktop.
Save jasonsperske/cb48dfe15cdbd8c4ad9f to your computer and use it in GitHub Desktop.
Nested for loops in scheme
(define (SO x y)
(let* ((x! (car x)) (y! (car y)))
(while (< x! (car (cdr x)))
(set! y! (car y))
(while (< y! (car (cdr y)))
(print (string-append (number->string x!) "-" (number->string y!)))
(set! y! (+ y! 1))
)
(set! x! (+ x! 1))
)
)
)
(SO '(15 20) '(30 35))
@jasonsperske
Copy link
Author

this was in response to a SQ question, and tested inside Gimp's Script-fu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment