[augeas-devel] Reformat function

Nate Foster jnfoster at cis.upenn.edu
Wed Jul 23 17:00:29 UTC 2008


I should add two things:

1. I may have misunderstood what you were proposing for "reformat". A
simple form of reformatting while ignoring the original string should
already available by the "create" function. Like "put", it converts a
tree into a string, but it ignores the original string. I'm not sure
if David has exposed "create" in the API / in unit tests (the web
pages don't mention it, but maybe they're incomplete), but it is
definitely in src/put.c. In particular, you need it to implement the
"put" function for Kleene-star.

The idea behind quotient lenses, described in the paper I linked to,
is a bit more general. Quotient lenses have "put" functions that
ignore some of the information in the string (so, e.g., you can have a
lens that *always* formats certain information like whitespace to
canonical values but correctly discards/restores other information).
This behavior is pretty simple to code up. What's tricky is showing
that it is still correct... the bulk of the paper is spent developing
a framework in which you can prove this.

2. Since my previous message was my first post to the list, I should
introduce myself: I'm a student at Penn and have been working on
lenses for a few years now. With my adviser, Benjamin Pierce, and a
few others, I've worked on the lens languages Boomerang (for strings)
and Focal (for trees). We have been trying for many years to get these
ideas out into the world, so we're thrilled to see so many interesting
lenses being built.

Also, we are planning a v0.1 release of Boomerang very soon (I'll post
the announcement here). If any of you are brave and interested in
playing with string-to-string lenses, we'd love to have users :-)

Nate

On Wed, Jul 23, 2008 at 11:45 AM, Nate Foster <jnfoster at cis.upenn.edu> wrote:
> We (the Boomerang guys) think this is a fantastic idea... and just
> wrote a paper on this topic :-)
>
> http://www.cis.upenn.edu/~jnfoster/papers/quotient-lenses.pdf
>
> Cheers,
> Nate
>
> On Wed, Jul 23, 2008 at 11:36 AM, Raphaël Pinson <raphink at gmail.com> wrote:
>> Hi,
>>
>> I was wondering if a 'reformat' command would be useful in augeas.
>> Currently, you can specify the default value for ignored expressions in
>> lenses (using 'del regexp default'). The idea of a 'reformat' command would
>> be to replace these ignored strings with the default, allowing people to
>> standardize their conffile in a pinch.
>>
>>
>> Just an idea...
>>
>>
>> Raphaël
>>
>> _______________________________________________
>> augeas-devel mailing list
>> augeas-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/augeas-devel
>>
>




More information about the augeas-devel mailing list