As long as you use '=' it's easy to keep programming C or MUMPS in Lisp. Avoiding '=' forces you to give up old habits and become fluent with (writing as well as reading) deeply nested calls, 'let' and recursion. Those are some big reasons to use Lisp rather than imperative languages. So if you don't use them you're missing out.
My code snippet is doing that. The let is doing a sort of pattern matching and binding latitude to the first element of the result, and longitude to the second.
I thought that let looked odd, because I thought that with a let in arc, you had 1 variable/value pair. Thanks, zck, for pointing out the difference. And thanks, akkartik, for repeatedly telling me this.
C:\Users\Steve\Documents\arc3.1>racket -f as.scm
Use (quit) to quit, (tl) to return here after an interrupt.
arc> ;; Get rid of rows-tried entries for column col
(def remove-column-number-from-rows-tried (column-# rows-tried)
(with columns-rows -1 list1 (rev rows-tried) list2 '()
(for i 1 (len rows-tried)
(= columns-rows (pop list1))
(if (~is (car columns-rows) column-#)
(push columns-rows list2)))
(rev list2)))
Error: "Can't take cdr of columns-rows"
arc>
I did see it running momentarily on Windows a few weeks ago: http://arclanguage.org/item?id=19458. It might have a few issues, but if you report them I'll try to fix them.
But this clutters up the namespace. We can use a local helper function to move make-list-helper inside the body of make-list, and wrap it in afn to make it able to recurse.
This is identical to your version, except I dropped the now-unnecessary base case (if now generates the initial list at the bottom-most recursive call) and moved the cons outside the call to make-list.
I'm surprised by the redefinition warnings. They don't happen for me. Perhaps you have some of your own code being loaded? Or maybe you have an old version? (Though I don't remember make-list ever being a thing.)
I believe that Kent Dybvig, author of The Scheme Programming Language, was one of the chief creators of ChezScheme. Over the years I heard good things about it, chiefly that it was very fast. Also the full version was expensive (~$1,000), although they did have a free interpreter (Petite ChezScheme). With the sale of it a few years ago, it seemed to disappear from view: E-mails to Cisco would not receive replies.
Seems to be quite good news that it is now open source. Wonder if arc would run under it and if it would be faster?