Feature request: scanf

Notices and updates
Locked
Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Feature request: scanf

Post by 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...

Artful code

scottmaccal
Posts: 20
Joined: Fri Mar 28, 2008 2:12 am

Re: Feature request: scanf

Post 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.
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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

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

scottmaccal
Posts: 20
Joined: Fri Mar 28, 2008 2:12 am

Post 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.
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
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post 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.
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Locked