[plt-scheme] XML schema equivalent but for scheme s-expressions

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Oct 25 10:33:54 EDT 2008

First, xexprs (an s-expression representation of xml) might be useful.
Look at the xml library.

Second, if you read-syntax, rather than read, then you get line numbers.

Third, sometimes when I want to do this sort of thing, I make the
configuration a program that returns a configuration object of my
program. Then, PLT Scheme does the work of parsing and validating,
etc. But this is not "safe".

Jay

On Fri, Oct 24, 2008 at 7:31 PM, rob <robertjparks at gmail.com> wrote:
> Hi all, I am working on a project where I want to use s-expressions to
> store some complex configuration information and I want an easy way to
> validate it. If the configuration was in XML I would simply write an
> XML schema and use a validating XML parser to validate it. Is there
> anything like this out there for normal scheme s-expressions? Also, is
> there an easy way to get line numbers when reading in an external file
> of s-expressions? For example, if I determine there is a problem with
> some part of the configuration, is there a way  that I can get the
> line number to print a message to the user where the problem occurred?
> Thanks and sorry if these are easy questions. I am new to lisp/scheme.
> -Rob
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://jay.teammccarthy.org

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.