Hi Henrik,

> (pipe (xml Html) (till NIL T))

What is the value of the variable 'Html' here? When 'xml' is called with
an argument, it expects a nested list, i.e. it outputs the structures in
that list as XML text.

>From what you write I'm not sure whether you want to convert list
structures to XML text (then the above 'pipe' call would be correct) or
vice versa.

> This works fine when I try the "raw" functionality without using the
> http server. However, when exactly the same code is called in the real
> application (within the context of the http server) the above results
> in NIL instead of the HTML.

The above 'pipe' call should be completely self-consistent. It does not
matter in which context it is running.

If, however, 'Html' is NIL (i.e. you intend to convert XML text to list
structures), then 'xml' would try to read from the current input channel
and would indeed depend on the input context.

> Trying (trace 'pipe) in the server

Ah, this does not work. Only "normal" functions (that evaluate all their
arguments) can be traced. 'trace' is not intelligent enough to know how
built-in functions evaluate their arguments.

> I've had exactly the same behavior happen to me when calling a ruby
> script through (call), It was resolved by using (in) instead, like
> this (which works):
> (in (list 'ruby "projects/rss-reader/htmldecode.rb" Str) (till))

Yes. For a pipe from some external process 'in' is the best solution.
Only when you need a pipe from one part in your program to another,
'pipe' is appropriate.

> Could the problem be that xml is outputting unchunked to pipe and the
> http server chokes on this?

This cannot happen, because (pipe (somePrinting) (someReading)) does not
know nor interfer with the http server. It just sends the output from
'somePrinting' to the input of 'someReading'.

- Alex

Reply via email to