Re: SXML-to-HTML-ext.scm issues
[email protected] Tue, 6 Jul 2004 14:17:01 -0700 (PDT)
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <[email protected]> |
Hello! > 1/ this file has 2 functions of general utility: lookup-def and > signif-tail. I think these belong in util.scm not here because they have > general usefulness I'm afraid I'm not sure that signif-tail is so general. It seems quite ad hoc. If I thought harder I might have gotten by without it. As to lookup-def, I agree about its utility. I seem to be writing something like that in almost every other file of my code. Alas, all those lookup-def are slightly different. For example, the associative list to look up in can be specified either as ((key . value) ...) or as ((key value) ...) the former is more common, in my experience. Yet the lookup-def in SXML-to-HTML-ext.scm uses the latter for obvious reasons. Also, what to do when the key is not found and there is no default? Sometimes I want to abort the execution because it just can't continue. Sometimes I wish to print a warning message and return #f. Sometimes I just wish to return #f. How to specify the default value or the lack of it is also not clear. Sometimes #f as 'no default' is OK. Sometimes I make the default argument optional. Sometimes specifying the default as a thunk is beneficial (cf. SRFI-44). So, while lookup-def is certainly a useful function, what is the best interface for it remains totally unclear to me.... > (define (lookup-def key alist default-value . warn?) Incidentally, you might find (define-opt ...) useful in this case. Please see myenv-chez.scm or myenv-bigloo.scm. > 3/ Is is possible to checkin util.scm and SXML-to-HTML-ext.scm with my > suggested mods? I would like to stay synchronized with the standard > repository for these functions. > 4/ Will Kiril's PLT version also have my updates if they get checked in? Michael Sperber is currently doing adjustments to the code to make sure everything is R5RS, and works in Scheme48 and PLT Scheme. He is also writing module declaration and interfaces, for Scheme48/PLT module system. That is a lot of work. The module system of Scheme48/PLT is very expressive, and so it makes the structure of the SSAX-SXML code far clearer. Perhaps we should wait making other changes until that job is finished. A more detailed message about the adjustments and modularization is forthcoming. ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com