Feature request: scanf

Started by Jeff, March 31, 2008, 05:48:47 AM

Previous topic - Next topic

Jeff

Lutz,



May we have a fast scanf-style reader to parse input in the next release?  Something the opposite of format, perhaps?
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

scottmaccal

#1
Quote from: "Jeff"Lutz,



May we have a fast scanf-style reader to parse input in the next release?  Something the opposite of format, perhaps?


I second that.
Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. --Richard Stallman

Lutz

#2
Did you read my other post about using (read-line)  for getting input from user? You can combine that and regular expressions with 'regex' or 'parse' to parse out the components from the input.

scottmaccal

#3
Quote from: "Lutz"Did you read my other post about using (read-line)  for getting input from user? You can combine that and regular expressions with 'regex' or 'parse' to parse out the components from the input.


Lutz,



I did. Thank you again. I can't believe I missed that in the manual! :-)



Thank you for creating and sharing newLISP too!



It is what I have been looking for. The first LISP that I began to feel comfortable with (after much pain) was Emacs Lisp. But newLISP is now my favorite.
Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. --Richard Stallman

Jeff

#4
I know, but scanf is faster, more exact, defines types, and uses *much* less memory.  Which is why programs still use scanf over regex in many scenarios.  Scanf gives me complete control over user input and guarantees that I get either the correct input and input types or that I get nothing at all.
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code