If you need tail-recursion (and I believe you don’t) accumulate the results in reverse order, and when you are done reverse the accumulated results.
A more Racket-y way I’ve done this is to use in-producer or in-port to make a sequence, and if you really need a list call sequence->list on it.
Oh or use for/list with one of the sequence makers
oh ok, ty everyone
im in trouble. im trying to make a module language. in the expander i use (provide (all-from-out racket/base)) and then i provide my bindings as well. when i run a test i made, a file with #lang reader "expander.rkt" in the same directory as my expander it says binding-that-im-sure-is-provided: unbound identifier; followed by also #%app isn't provided . which cannot be true because im providing all from out racket/base (i tried doing it explicitly, it also didnt work). the repl in drracket works fine. so i know it’s receiving #%top-interaction
a minimum example, from what i understand i have to do? ;; reader.rkt
#lang racket/base
(require (rename-in racket/base
[read-syntax base-read-syntax]))
(provide read-syntax)
(define (read-syntax path port)
#`(module mod-name racket/base
#,(base-read-syntax path port)))
;; test.rkt
#lang reader "reader.rkt"
(println 3) same error?
I think you need strip-context in your read-syntax
Note that strip-bindings in beautifulracket = strip-context in Racket
oh… i need to reread this entire book…
i started my racket journey with it, but even if i typed every line of code by myself, a lot went over my head…
If your language will be S-expression based, why don’t you use #lang s-exp though?
oh isnt s-expression based that was just an example
nice it almost works! … but my binding is still missing :upside_down_face: ill keep reading that chapter and see what happens
ok now it does work
THANK YOUUUUUUUUUUU