From: David Douthitt
Subject: Araneida and HTML Generation
Date: 
Message-ID: <cdpd54$p1e$1@grandcanyon.binc.net>
I'm utilizing the Araneida Web Server on a Linux/x86 system with SBCL 
and pgsql.lisp.  The docs describe a way to generate HTML, but the 
examples all fail, and examples/main.lisp does not exist.

Running the example given in the Araneida docs page gives the following 
output in SBCL:
-----------------------------------------------------

* (html
  (head (title "Title"))
  (body (p "Click here to visit ((a :href "http://www.google.com/") 
"Google"))))


debugger invoked on a SB-KERNEL:READER-PACKAGE-ERROR in thread 6419:
   READER-ERROR on #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {5035259}>:
package "HTTP" not found

You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [ABORT   ] Reduce debugger level (leaving debugger, returning to 
toplevel).
   1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
(SB-IMPL::READ-TOKEN 2 #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* 
{5035259}> #\h)[:EXTERNAL]

-----------------------------------------------------
I'm new to any serious LISP programming so I'm not sure where to go 
next.  I have also tried using lml2, but when I got it running, I tried 
the example from the web site, and get this:
-----------------------------------------------------

* (html
    (:i "The square of the first five integers are: )"
    (:b
    (loop as x from 1 to 5
      doing
      (lml-format " ~D" (* x x))))

)
)
; in: LAMBDA NIL
;     (LML-FORMAT " ~D" (* X X))
;
; caught STYLE-WARNING:
;   undefined function: LML-FORMAT

;
; caught STYLE-WARNING:
;   This function is undefined:
;   LML-FORMAT
;
; compilation unit finished
;   caught 2 STYLE-WARNING conditions

debugger invoked on a UNDEFINED-FUNCTION in thread 27973:
   The function LML-FORMAT is undefined.

You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [ABORT   ] Reduce debugger level (leaving debugger, returning to 
toplevel).
   1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
(SB-KERNEL::UNDEFINED-FUN-ERROR-HANDLER
  4
  #<unavailable argument>
  #.(SB-SYS:INT-SAP #X40382A20)
  #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X40382720 :TYPE (*
                                                          (STRUCT
 
SB-VM::OS-CONTEXT-T-STRUCT))>
  (14))[:EXTERNAL]
0]

-----------------------------------------------------
Note that I had to add two more parenthesis to make it "work."  I then 
tried (use-package) but I get this:
-----------------------------------------------------

* (use-package :lml2)

debugger invoked on a SIMPLE-ERROR in thread 27973:
   Using package LISP-MARKUP-LANGUAGE-2 results in name conflicts for 
these symbols:
(LML-FORMAT HTML)

You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [CONTINUE] Unintern the conflicting symbols in the 
COMMON-LISP-USER package.
   1: [ABORT   ] Reduce debugger level (leaving debugger, returning to 
toplevel).
   2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
("hairy arg processor for top level local call USE-PACKAGE"
  :LML2
  #<PACKAGE "COMMON-LISP-USER">)
0]

-----------------------------------------------------
I feel more than a little blind here.  How do I get this HTML generation 
to work from Araneida?  If you're feeling generous, how do I then 
connect the HTML output to a server response?  The docs that came with 
Araneida are rather obtuse and tell you several times to "read the code" 
- which doesn't help me.

Thanks!

David Douthitt
From: David Douthitt
Subject: Re: Araneida and HTML Generation
Date: 
Message-ID: <cdpfbe$pk9$1@grandcanyon.binc.net>
David Douthitt wrote:

> -----------------------------------------------------
> I'm new to any serious LISP programming so I'm not sure where to go 
> next.  I have also tried using lml2, but when I got it running, I tried 
> the example from the web site, and get this:
> -----------------------------------------------------
> 
> * (html
>    (:i "The square of the first five integers are: )"
>    (:b
>    (loop as x from 1 to 5
>      doing
>      (lml-format " ~D" (* x x))))
> 
> )
> )

I solved part of the problem (of the extra ")" needed).  First, one of 
the ")" markers was unaccounted for - and secondly, the second one is 
"needed" because the (:i ...) sexpr has the ending quote and right paren 
mixed up.

David Douthitt