# Reader module for reading multiple lines

**URL:** <https://racket.discourse.group/t/reader-module-for-reading-multiple-lines/476>\
**Category:** Questions & Answers\
**Created:** [December 25, 2021, 3:16pm UTC](https://racket.discourse.group/t/reader-module-for-reading-multiple-lines/476 "2021-12-25T15:16:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [December 25, 2021, 3:16pm UTC](https://racket.discourse.group/t/reader-module-for-reading-multiple-lines/476/1 "2021-12-25T15:16:02Z")

</div>

hello,

i want to modify the reader (read file) to be able read difinitions , modify them to generate racket code and evaluate expressions .

starting from this code:

[https://docs.racket-lang.org/guide/hash-lang\_reader.html](https://docs.racket-lang.org/guide/hash-lang_reader.html)  
the difference is that i do not want to deal with a single string but a lot of lines with CR as separation and generate for each line one expression until EOF

how can i do that?

Damien

---

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [December 25, 2021, 11:00pm UTC](https://racket.discourse.group/t/reader-module-for-reading-multiple-lines/476/2 "2021-12-25T23:00:49Z")

</div>

starting to have a beginning of solution:

```scheme
#lang racket
(require syntax/strip-context)
 
(provide (rename-out [literal-read read]
                     [literal-read-syntax read-syntax]))

(define (literal-read in)
  (syntax->datum
   (literal-read-syntax #f in)))
 
(define (literal-read-syntax src in)
  (define lst0 '(1 2 3 4 5 6 7))
  (define str0 (port->string in))
  (with-syntax ([str str0]
		;;[lst (syntax->list (syntax (1 2 3 4 5)))])
		[lst lst0])
		(strip-context
		 #'(module anything racket
			   'str))))
			   ;;'lst))))

```
