Subject: Re: Use of lambda From: Chris Maden <crism@xxxxxxx> Date: Thu, 26 Feb 1998 14:09:37 -0500 |
[Dan Speck] > You aren't calling the function in the above (string-append "..." > pages "...") you are accessing the value of the variable pages which > should be a function of no arguments. You should be getting an error > message when (string-append ...) tries to append its string > arguments to the procedure that pages evaluates to. In order to call > the function you need to wrap the pages variable in parentheses, > e.g., (pages). Perhaps you could post a complete code fragment that > demonstrates Jade's behavior when presented with the above? [Dave Love] > This seems confused, but I'm not sure how without more context. On > the basis of the above fragment, Jade has a bug since the second > argument of string-append is a function, not string. Do you > _really_ mean that it's evaluated as (string-append "..." (pages) > "...")? It's not what I see: Here's the definition of pages: ;; pages is a string for inclusion as MIF Pages. (define pages (lambda () (string-append "<Page <PageType LeftMasterPage> <PageTag `Left'> <TextRect <ID 1> ... yadda yadda ... <TextFlow <Para <PgfTag `Header'> <ParaLine <TextRectID 4> <Variable " (if (member (gi (current-node)) '("GLOSSARY" "GLOSSDIV" "PREFACE")) " <VariableName `Running H/F 3'> " " <VariableName `Running H/F 4'> ") " > # end of Variable <Char Tab> <Variable <VariableName `Current Page #'> > # end of Variable > > # end of Para > # end of TextFlow ... yadda yadda ... "))) Here's the procedure that calls it: (define (make-mif-start page-num page-num-style) (sosofo-append (make formatting-instruction data: (string-append "<MIFFile 5.00> # Generated by Jade 1.0 <PgfCatalog " ;; some stuff - then: pages "<TextFlow <TFTag `A'> <TFAutoConnect Yes> <Notes ")) ;; process footnotes (make-footnotes) (make formatting-instruction data: " > # end of Notes "))) Here's what I get: [... stuff before pages gets called ...] <Page <PageType LeftMasterPage> <PageTag `Left'> <TextRect <ID 1> [... stuff omitted ...] <TextFlow <Para <PgfTag `Header'> <ParaLine <TextRectID 4> <Variable <VariableName `Running H/F 4'> > # end of Variable <Char Tab> <Variable <VariableName `Current Page #'> > # end of Variable > > # end of Para > # end of TextFlow You can see that the conditional for TextRectID 4 is correctly evaluated. Is it because the procedure was included in another procedure? Is Jade unusually tolerant in this case? Thanks, Chris -- <!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN"> <!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN" "<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487 <USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek> DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Use of lambda, Daniel Speck | Thread | Re: Use of lambda, Dave Love |
Re: Keeping Text Together, Dave Love | Date | Lambda: I lied, Chris Maden |
Month |