Am I missing something? Won't the first (from) basically find the
first instance of "<item" and put the reader at that place? If I use
match here am I not matching on the whole of the rest of the document?

If we take the code again and pretend that regular expressions worked
then what I need would look like this in order to get the list of
items:

(in "rss.xml"
  (while
     (from "<item[^>]*>")
     (println
        (make
           (loop
              (NIL (chain (till ">")))
              (char)
              (T (tail '`(chop "item") @)) ) ) ) ))

Maybe this is clearer, so obviously we can't use the above but what to
do in order to replace it with something that is equivalent and legal?

/Henrik

On Tue, Nov 3, 2009 at 5:41 PM, Alexander Burger <a...@software-lab.de> wrot=
e:
> On Tue, Nov 03, 2009 at 04:24:55PM +0100, Henrik Sarvell wrote:
>> (in "rss.xml"
>> =A0 =A0(while
>> =A0 =A0 =A0 (from "<item")
>> =A0 =A0 =A0 (println
>> =A0 =A0 =A0 =A0 =A0(make
>> =A0 =A0 =A0 =A0 =A0 =A0 (loop
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(NIL (chain (till ">")))
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(char)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(T (tail '`(chop "item") @)) ) ) ) ))
>>
>> This will accurately capture the <item> tag all the time I think but
>> then we need some way of discarding the attributes and the closing >.
>
> I think that from this point on 'match' is the easiest and most general.
> What 'make' returns is not so big any more, and has also perhaps more
> predictable patterns.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe
>
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to