do-loops

Other ways to deal with "loop initialization" in C#

To start with I'll say that I agree that goto statements are largely made irrelevant by higher level constructs in modern programming languages and shouldn't be used when a suitable substitute is available. I was re-reading an original edition of Steve McConnell's Code Complete recently and had forgotten about his suggestion for a commo...

Scheme/Racket: do loop order of evaluation

The following procedure is valid in both scheme r6rs and Racket: ;; create a list of all the numbers from 1 to n (define (make-nums n) (do [(x n (- x 1)) (lst (list) (cons x lst))] ((= x 0) lst))) I've tested it for both r6rs and Racket and it does work properly, but I only know that for sure for DrRacket. My question is i...