![]() ![]() Nothing requires read and read-syntax to parse input in the same way, but making them different would confuse programmers and tools. More precisely, the read function will be used when the enclosing stream is being parsed by the Racket read, and read-syntax is used when the enclosing stream is being parsed by the Racket read-syntax function. The difference between read and read-syntax is that read is meant to be used for data while read-syntax is meant to be used to parse programs. Since the first character immediately after “ five.rkt” is a space.Ī #reader form can be used in the REPL, too: Similarly, the reader functions from “ f ive.rkt” are not obliged to ignore whitespace, and Since only the 23456 part is consumed by read or read-syntax, the 7 remains to be parsed in the usual Racket way. The reader functions from “ five.rkt” are not obliged to follow Racket lexical conventions and treat the continuous sequence 234567 as a single number. The ‹reader-specific› part is a sequence of characters that is parsed as determined by the read and read-syntax functions from ‹module-path›.įor example, suppose that file “ five.rkt” containsīecause the read and read-syntax functions of “ five.rkt” both read five characters from the input stream and put them into a string and then a list. Where ‹module-path› names a module that provides read and read-syntax functions. ![]() The module exports functions that parse raw characters into a form to be consumed by the expander layer. A reader extension is implemented as a module that is named after #reader. The reader layer of the Racket language can be extended through the #reader form. Oggi qui /guide/languages.html, in particolare qui /guide/module-languages.html dove continuo a copiare da qui. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |