
hello. im’m write simple code for convert string into list of tokens. My question - is more simple way for converting, than my code
(define (lex-list s) (let ((buf (open-input-string s))) (let loop ((results ’())) (let ((next-token (lexer buf))) (if (eq? ’EOF (token-name (position-token-token next-token))) (reverse results) (loop (cons next-token results)))))))

@wwall I might write it like this:

(define (lex-list s)
(define buf (open-input-string s))
(for/list ([next-token (in-producer (λ () (lexer buf)))]
#:break (eq? 'EOF (token-name (position-token-token next-token))))
next-token))

Someone on Reddit reported an issue that seems to be .zo
files not being used: https://www.reddit.com/r/Racket/comments/713v6h/horrible_performance/

@mflatt I think we’ve seen issues like this before, but I can’t find the discussion in my email archives

I am making a image generator program but my image function was with 2htdp is there something I can do use (require) for the function?

(require 2htdp/image)

What I want is to make the function available to the rest of the program.

@mtelesha I’m unsure what you mean, could you provide more details?

I mean (provide) with my function that is (require 2htdp/image) the rest of my program is #lang racket

@mtelesha you can use 2htdp/image
in #lang racket

@mtelesha This should work:
#lang racket
(require 2htdp/image)
(define (my-image-func arg ...) ...)
(provide my-image-func)

provide = provide: this function is not defined

1 sec

I didn’t think you could mix #lang racket with 2htdp

2htdp/image
is a normal library that any module can require
and #lang 2htdp
will automatically require
it for you (I think)

LOL I lost a few hours trying to redo my function with pict 2htdp scale/xy

Glad to help :)