Re: FORMAT/scanf style input parsing



Matthew Swank <akopa_is_very_much_like_my_email@xxxxx> wrote:
Lisp has read. Read is nice enough. However, since at least the time of
fortran many computer languages have supported simple input parsing
based on the same kinds of specifications used to generated formatted
output. Witness C's scanf/printf, fortran's FORMAT, and C#'s
IFormatProvider interface.

Has lisp ever had support for parsing based on some subset of format
control-string language? The reason I ask is that after porting some old
fortran in the recent past, I realize that i kind of miss having a
way to conveniently parse moderately structured input. I know for
extremely simple things there are libs like SPLIT-SEQUENCE, and cl-ppcre
and parser generators for more complicated parsing. However, there is a
sweet spot for parsers like FORMAT (not to mention the symmetry of
notation).

There's an implementation of (SETF FORMAT):

http://www-jcsu.jesus.cam.ac.uk/~csr21/format-setf.lisp

--
Juho Snellman
.



Relevant Pages

  • Handling fractions of seconds in strftime/strptime
    ... Python's date parsing is based ... on strptimewhich can't handle fractions of seconds. ... I realize that other languages may not base their current time ... seconds or adding a new format specifier like "%F" to handle this ...
    (comp.lang.perl.misc)
  • Handling fractions of seconds in strftime/strptime
    ... Python's date parsing is based ... on strptimewhich can't handle fractions of seconds. ... I realize that other languages may not base their current time ... seconds or adding a new format specifier like "%F" to handle this ...
    (comp.lang.python)
  • Handling fractions of seconds in strftime/strptime
    ... Python's date parsing is based ... on strptimewhich can't handle fractions of seconds. ... I realize that other languages may not base their current time ... seconds or adding a new format specifier like "%F" to handle this ...
    (comp.lang.tcl)
  • FORMAT/scanf style input parsing
    ... fortran many computer languages have supported simple input parsing ... Has lisp ever had support for parsing based on some subset of format ...
    (comp.lang.lisp)
  • [ANN] python-dateutil 1.0
    ... * Computing of relative deltas (next month, next year, ... Parsing of RFC strings is ... * Timezone implementations for tzfileformat ... local machine timezone, fixed offset timezone, UTC ...
    (comp.lang.python.announce)