Page 1 of 1

Feature request: scanf

Posted: Mon Mar 31, 2008 12:48 pm
by Jeff
Lutz,

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

Re: Feature request: scanf

Posted: Thu Apr 03, 2008 1:28 am
by scottmaccal
Jeff wrote: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.

Posted: Thu Apr 03, 2008 1:43 am
by 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.

Posted: Fri Apr 04, 2008 1:14 am
by scottmaccal
Lutz wrote: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.

Posted: Fri Apr 04, 2008 11:54 am
by Jeff
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.