Hi Alex,

>> 'pipe' worked fine except when run in a server which returned NIL.
>
> This would indeed be a bug in the PicoLisp kernel. Do you think you can
> construct a simple, stand-alone example that demonstrates this effect?

the following script shows the bug:

====

#!bin/picolisp lib.l

(load "@ext.l" "@lib/http.l" "@lib/xhtml.l")

(de prinLength1 (X)
#   (length X))
   (length (pipe (prin X) (line T))))

#(test 2 (prinLength1 "hi"))
#(test 5 (prinLength1 'hello))
#(test 9 (prinLength1 '(1 2 3 4 56 789)))

(de start1 ()
   (for X (mapcar prinLength1 '("hi" "hello" (1 2 3 4 56 789)))
      (html 0 "Hello" "lib.css" NIL
         (<br> (ht:Prin X)))))

(de start2 ()
   (msg "start2")
   (msg (prinLength1 "bug"))
   (msg (length "bug"))
   (html 0 "Hello" "lib.css" NIL
      (for X '("hi" "hello" (1 2 3 4 56 789))
         (<p> NIL (ht:Prin X) " " (ht:Prin (prinLength1 X))))))

(server 8080 "@start2")

====

It works with

(de prinLength1 (X)
   (length X))

but breaks with

(de prinLength1 (X)
   (length (pipe (prin X) (line T))))

(msg ...) show prinLength1 0 for the server version.

However, the tests

(test 2 (prinLength1 "hi"))
(test 5 (prinLength1 'hello))
(test 9 (prinLength1 '(1 2 3 4 56 789)))

pass when not run in a server.

Also, when using pipe version, the http output is messed up...

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to