Honestly, judging from the responses in this thread, it would seem there
may be a hole in Racket’s toolbox. Nothing I’ve seen so far is
particularly stellar, especially since this is a problem that does not
seem like it should be hard.

It may be overkill for this use case, but I would probably use the
parsack package, since I think its interface is pretty intuitive.
However, it would be nice to have some sort of inverse to printf that
parses values given a template string. Racket has a very good set of
tools for formatting text, but it seems that doing the inverse is much
harder, which seems to be against Racket’s “batteries included”
philosophy.

Would anyone object to a scanf-like function in Racket itself? The
obvious point of difficulty is how to handle errors, given that parsing
can fail but printing cannot. Should it throw an exception, or should it
return #f? I’m not sure there is great precedent set here, though
throwing seems to be the Racket way in other places.

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