Re: parsing format/{1,2,3} format strings

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXuZoJbFae0+C4DLtznspg=gOFcExxA7D5YktCszc1App6A@mail.gmail.com>
Thanks Anne.  Wouter has an impressive collection there.  I didn't see
anything for format strings, so I'll go ahead and write my own.  I'll
probably release it as a pack when it's ready, so Wouter can reuse the code
that way if he wants it.

Jan,

On Thu, Dec 26, 2013 at 5:00 AM, Jan Wielemaker <[email protected]> wrote:

> You want to do type checking for the arguments?
>

Initially I just want static arity checking.  It's surprising how often I
provide too many or few arguments to format/2.  Of course, giving too few
arguments throws an exception but it should be easy enough to detect that
statically.

Eventually, I want to perform type checking.  I also want to use format
patterns for local type inference.  I have an idea for implementing
Erlang-style <http://www.erlang.org/doc/man/dialyzer.html> success
typing<http://user.it.uu.se/~kostis/Papers/succ_types.pdf> on
top of the types framework used by library(error) and library(mavis).
 Format patterns could provide helpful information during that process.
 They also represent a slightly unusual type inference technique (inferring
types from a DSL embedded in a string).  I want to make sure I can support
that sort of thing.  Dart's analyzer does something similar by looking
inside CSS selectors <https://code.google.com/p/dart/issues/detail?id=4238> and
I've found it highly productive when it applies.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.