Re: Global Variables and JADE vs OMNIMARK

Subject: Re: Global Variables and JADE vs OMNIMARK
From: Mike Sosteric <mikes@xxxxxxxxxxxxx>
Date: Tue, 8 Dec 1998 13:22:12 -0700 (Mountain Standard Time)
>Hi, Mike...
>   First of all, let me just lay a little groundwork, to make sure
>we're on the same page.  

<snip> thanks for the info! I don't quite understand it all, but whenever I go back 
to it, I understand a bit more. 

I'll walk through this, correct me i'm wrong

>(define (get-publisher-name node)
>  (let* ((gr (node-property 'grove-root node))

This first one assigns the root of the grove to the variable gr. Why the named let. I tried
this without the * and it didn't work.

>         (de (node-property 'document-element gr)))

This assigns the top level document element to de. THis would be <HTML> if the document 
was HTML

>    (let loop ((nl (node-property 'content de)))

this assigns everything below <HTML> as a nodelist to nl.

>      (if (node-list-empty? nl) #f

 this tests to make sure we haven't descended all the way down and found nothing. 

>          (let ((nd (node-list-first nl)))

 this assigns the left hand, top most node list to nd and then tests it

>            (or (and (equal? 'element (node-property 'class-name nd))
         I HAVEN"T a clue what (or (and (equal means except maybe its a joke played on the 
unwitting masses by the developers of LISP :-)
>                     (if (and (string=? "NAME" (gi nd))
>                              (string=? "PUBLISHER" (gi (node-property 'parent nd))))
	 if the current gi is NAME and the parent of the current gi is PUBLISHER then
                        > (data nd)
			 assign the data in nd to data and return a string

                        > (loop (node-property 'content nd)))
>                (loop (node-list-rest nl))))))))

   Hope this helps (and doesn't confuse you any further).

I just don't get the (or (and (equal? construct and how it is able to determine of the string
is the right one. 

My other question is is it possible to replace "NAME" with (BOTTOMEL) and "PUBLISHER" with 
(TOPEL) to get a more generic function? 

Well I can read most of it. Its those scheme loops that are a bugger.

thanks Brandon


 DSSSList info and archive:

Current Thread