Hi Matthew, Phillip,

Forgive the delayed response. I'm better positioned to resume my study on
this, and I did not want to close this thread without the thanks that you
deserve.

Both solutions shine in their own way. Phillip's casework has been
exceptionally helpful in shaping thoughts for a more polished experience,
and even though Matthew's concise approach halts racket koans/all.rkt before
rackunit can print a report, it does not contradict reading order (meaning
a newbie can iterate off the "blanks detected" feedback without getting
directed somewhere "later" in the koans)

Thank you both. This has been more than helpful


On Sun, Aug 26, 2018 at 10:03 PM Matthew Butterick <m...@mbtype.com> wrote:

>
> On Aug 26, 2018, at 5:15 PM, Sage Gerard <zyrolast...@gmail.com> wrote:
>
> The intent is to reject code with blanks, and to treat code without blanks
> as Racket code that still might not compile
>
>
>
> There's more than one way to go about it, of course. It could be simpler
> to make a wrapper around the usual `read-syntax` and inspect the individual
> syntax objects as they pass by:
>
>
> ;;;;;;;;;;;;;;;;;; "racket-koans-lang.rkt"
>
> #lang racket
> (require syntax/strip-context rackunit)
> (provide #%module-begin (except-out (all-from-out racket) read-syntax)
>          (rename-out [koan-read-syntax read-syntax])
>          (all-from-out rackunit))
>
> (define (koan-read-syntax path ip)
>   (define stxs (parameterize ([current-input-port ip])
>                  (for/list ([stx (in-port read-syntax)])
>                            (when (memq '_____ (flatten (syntax->datum
> stx)))
>                              (raise-syntax-error 'koans "blanks detected"
> stx))
>                            stx)))
>   (strip-context
>    (with-syntax ([(STX ...) stxs])
>      #'(module _ "racket-koans-lang.rkt"
>          STX ...))))
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to