Dear Alexander,

I also tried the following; using picolips and loaded lib.l misc.l xhtml.l http.l then run (apply script "" "..project.l") returns the html response bu there is a bus error and the end:

taoufik-dachraouis-imac:picoLisp taoufik$ picolisp
: (load "lib.l")
-> view
: (load "lib/xhtml.l")
[lib/xhtml.l:6] !? (mapc allow '(*Menu *Tab *ID))
NIL -- Undefined
? (load "lib/misc.l")
-> test
? (load "lib/xhtml.l")
-> <reset>
? (apply script "" "/Users/taoufik/workspace/picolisp/project.l")
[/Users/taoufik/workspace/picolisp/project.l:2] !? (httpHead NIL Upd)
httpHead -- Undefined
? (load "lib/http.l")
-> http404
? (apply script "" "/Users/taoufik/workspace/picolisp/project.l")
HTTP/1.0 200 OK
Server: PicoLisp
Date: Sat, 03 Oct 2009 11:01:41 GMT
Cache-Control: max-age=0
Cache-Control: private, no-store, no-cache
Content-Type: text/html; charset=utf-8

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " ">
<html xmlns=""; xml:lang="en" lang="en">
<link rel="stylesheet" type="text/css" href="http://:/lib.css"/>
Bus error
taoufik-dachraouis-imac:picoLisp taoufik$

Kind regards

On Oct 3, 2009, at 12:44 PM, Alexander Burger wrote:

Hi Taoufik,

thanks for the feedback!

I manually traced http.l (inserting prinl instruction in the http
function in http.l, and

Hmm, does this really work? During 'http', the output is redirected to
the client (via the socket to the browser), so 'prinl' usually does not
work well because it intermixes its output with the HTML code.

You could use 'msg', as this will send its output to standard error.

Or, even better, use the 'trace' function, in the extreme by simply
tracing all Lisp level functions with 'traceAll':

  ./dbg lib/http.l lib/... -traceAll -'server ...'

'traceAll' traces only functions that are defined in Lisp. I would
suggest to trace also some primary functions, perhaps 'line':

  ./dbg ...  -traceAll  -"trace 'line"  -'server ...'

This will produce a lot of output. The interesting part will be near the
end, shortly before it crashes.

taoufik-dachraouis-imac:picoLisp taoufik$ cat x.l
(* 2 3)
taoufik-dachraouis-imac:picoLisp taoufik$ picolisp
: (script "x.l")
!? (script "x.l")
script -- Undefined

This function is defined in "lib.l". Ususally it does not make much
sense to start the plain 'picolisp' executable alone. Better (as you did above) use "./dbg", which also loads the basic environment and debugging

  $ ./dbg
  : (script "x.l")
  -> 6

- Alex

Reply via email to