Re: Issues with literate programming DSSSL Script

Subject: Re: Issues with literate programming DSSSL Script
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Fri, 17 Dec 1999 13:09:06 -0600
Quoting Wroth, Mark <MARK.WROTH@xxxxxxxxxxx>:
> On a related note: what's wrong with this selector?
> 
> (with-mode continuation
>   (process-node-list
>      (select-elements (descendants (document-element (current-node)))
>        '(scrap (continues attribute-string "id")))))
> 
   Try this, instead:
         `(scrap (continues ,(attribute-string "id")))
   The problem here is that the single quote in your version quoted
the *entire* expression, meaning that the "attribute-string" symbol
and the "id" string got passed in as part of the pattern, rather than
being evaluated and replaced with the value of the "ID" attribute.
The backquote, above, introduces a "quasi-quote" expression, which is
similar to a regular quoted expression, except that you can "unquote"
certain parts of it, so that they will be evaluated.  In this case,
we're unquoting the (attribute-string) call, such that the final
result of this would be a structure like:
         (scrap (continues "ABC"))
if the current node was an element with an ID of ABC, that is. :)

-Brandon :)


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread