When I looked at Lisp for the first time I knew 6 languages and had experienced that learning a new language was very simple. Unfortunately the experience I had wasn't really how to learn a new language since when I thought I knew 6 languages the truth is that I knew 6 dialects springing from a common ancestor called Algol. Perl, Java, C++ are almost the same language and if you know one you know how to do the other within a day.
You need to find yourself a nice book or resource that you can follow and learn Scheme as if you have never ever known a programming language before. You can have a look at the Rosetta Code for Scheme to compare how some algorithms are done in Scheme but even if you see the tasks have similar structure they tend to do quite different things.
;; roll your own using recursion
(define (my-display lst)
(when (pair? lst)
(display (car lst))
(newline)
(my-display (cdr lst))))
;; one with higher order procedures
(define (my-display lst)
(for-each (lambda (e)
(display e)
(newline))
lst))
;; Close to your algol for loop
(let make-number ((count 6))
(if (< count 25)
(begin
(display count)
(newline)
(make-number (+ count 6)))
'return-value))
;; A better approach
;; make a list of the numbers based on start end and step
(define (make-range start end step)
(let rec ((cnt start))
(if (> cnt end)
'()
(cons cnt (rec (+ cnt step))))))
(my-display (make-range 6 25 6)) ; prints the numbers
;; one with higher order procedures
;; uses SRFI-1 List Librarys unfold instead of named let
(define (make-range start end step)
(unfold (lambda (x) (< end x))
values
(lambda (x) (+ x step))
start))
I do not recommend you to use the do
loop. Use named let
or higher order procedures and keep the printing part outside.
I really enjoyed the SICP video lectures. They are a tad old and thus are a older version of Scheme than today, but someone has made support for it in racket. When you know one lisp language it's easy to learn a different dialect, especially a later Scheme report.