On Wed, Mar 23, 2016 at 8:26 AM, WarGrey Gyoudmon Ju <juzhenli...@gmail.com>
wrote:

> In Racket, (read) and (write) know all the builtin datatypes
> <https://docs.racket-lang.org/reference/reader.html?q=readtable#%28part._parse-number%29>
>  which
> are already structured more than a stream of bytes (like in C).
> Thus, you don't need scanf to tell Racket what is the type of the next
> token.
>
> That *is* painful in a situation like coding challenges since the input
> format is language independent (however actually it's the C style).
> Of course this kind of situation also has its own fixed format, you can
> define your own read tables
> <https://docs.racket-lang.org/reference/readtables.html?q=readtable> :
> 1. the "," is special in Racket, you need to drop off them first;  
> (with-input-from-string
> "[04 foo 03.5]" read) gives you '(4 foo 3.5) directly.
> 2. Symbols are internal Strings, you need (symbol->string) to covent them
> into normal Strings (Yes, sometimes, I think if there are string-like or
> bytes-like APIs that work on symbols directly).
>
>
Sorry, please forget the Read Table, it makes things more complex here.

-- 
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