Skip to content

1.6.0

Choose a tag to compare

@fosskers fosskers released this 20 Oct 22:55
· 11 commits to master since this release
1b3df85

The theme of this release is "type information". Overall, function signatures
have been greatly elaborated across the various systems.

Added

  • ->, fn, always, and maybe for concise definition of function
    signatures that involve parsers.
  • Parser: sliding-take and sliding-take1 for parsing escaped characters
    efficiently.

Changed

  • <$ is now a macro.
  • between is now a macro.
  • :fail can be returned from the lambda given to ap to fail the whole parse.
    This is useful for manually validating the results of parse.
  • toml: Improved performance.
  • xml: Improved performance.

Removed

  • Certain parsers no longer have an internal, automatically managed "lambda
    cache". In any case, it is considered best practice to instead define your own
    top-level, preallocated parsers for known cost-centers. These often involve
    char, string, between, and consume. For instance, you should
    essentially always define:
(defparameter +colon+ (p:char #\:))

And call +colon+ at usage sites, instead of using p:char directly within
your composite parsers. This avoids a significant amount of lambda allocation at
runtime. By doing this consistently you can expect a 3x-10x reduction in memory
allocation and a 2x-3x speed up.

For parsers/combinators that have a &key id in their arguments lists, the
argument have been left alone to avoid API breakage, although it now has no
effect. Even so, you should define your own defparameters for these as well.