From: Slobodan Blazeski
Subject: cl-who:with-html-output-to-string question
Date: 
Message-ID: <65b4b051-7ba8-4ce0-834e-b0bbabd46596@p69g2000hsa.googlegroups.com>
This questionsupposed to go to cl-who devel but confirmation email for
confirmation of  subscribtion of the cl-who mail list isn't coming in
my inbox.

I'm trying to produce this output
"<texarea name='NAME' type='TYPE'>value</texarea>"
With this everything is ok:
(cl-who:with-html-output-to-string (s)
		   (:texarea :name 'name  :type 'type "value"))
"<texarea name='NAME' type='TYPE'>value</texarea>"

but why doesn't below work (value is missing)
 (cl-who:with-html-output-to-string (s)
		   (:texarea :name 'name  :type 'type 'value))
"<texarea name='NAME' type='TYPE'></texarea>"

or this
 (cl-who:with-html-output-to-string (s)
		   (:texarea :name 'name  :type 'type (princ-to-string 'value)))
or this
(let ((val "value"))
   (cl-who:with-html-output-to-string (s)
      (:texarea :name 'name  :type 'type val)))
"<texarea name='NAME' type='TYPE'></texarea>"


How to write a function like this
(defun test (name type value)
    (cl-who:with-html-output-to-string (s)
	 (:texarea :name name  :type type value)))

that will render the value
(test 'name 'type 'value)
"<texarea name='NAME' type='TYPE'></texarea>"
(test 'name 'type "value")
"<texarea name='NAME' type='TYPE'></texarea>"

thanks
Slobodan

From: Sohail Somani
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <A0g7j.29452$Ji6.7662@edtnps89>
On Mon, 10 Dec 2007 10:23:21 -0800, Slobodan Blazeski wrote:

> but why doesn't below work (value is missing)
>  (cl-who:with-html-output-to-string (s)
> 		   (:texarea :name 'name  :type 'type 'value))
> "<texarea name='NAME' type='TYPE'></texarea>"
> 
> or this
>  (cl-who:with-html-output-to-string (s)
> 		   (:texarea :name 'name  :type 'type (princ-to-string 
'value)))
> or this
> (let ((val "value"))
>    (cl-who:with-html-output-to-string (s)
>       (:texarea :name 'name  :type 'type val)))
> "<texarea name='NAME' type='TYPE'></texarea>"

I think you have to change the use to something like:

 (:textarea :name 'name :type 'type (cl-who:str (princ-to-string 'value)))

-- 
Sohail Somani
http://uint32t.blogspot.com
From: Slobodan Blazeski
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <2a765f92-5286-41c2-a9ad-116b318e4484@b1g2000pra.googlegroups.com>
On Dec 10, 7:59 pm, Sohail Somani <······@taggedtype.net> wrote:
> On Mon, 10 Dec 2007 10:23:21 -0800, Slobodan Blazeski wrote:
> > but why doesn't below work (value is missing)
> >  (cl-who:with-html-output-to-string (s)
> >               (:texarea :name 'name  :type 'type 'value))
> > "<texarea name='NAME' type='TYPE'></texarea>"
>
> > or this
> >  (cl-who:with-html-output-to-string (s)
> >               (:texarea :name 'name  :type 'type (princ-to-string
> 'value)))
> > or this
> > (let ((val "value"))
> >    (cl-who:with-html-output-to-string (s)
> >       (:texarea :name 'name  :type 'type val)))
> > "<texarea name='NAME' type='TYPE'></texarea>"
>
> I think you have to change the use to something like:
>
>  (:textarea :name 'name :type 'type (cl-who:str (princ-to-string 'value)))
>
> --
> Sohail Somanihttp://uint32t.blogspot.com

Many thanks Sohail, it solved my problem

Slobodan
From: Maciej Katafiasz
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <fjk3on$s0j$2@news.net.uni-c.dk>
Den Mon, 10 Dec 2007 18:59:44 +0000 skrev Sohail Somani:

>> (let ((val "value"))
>>    (cl-who:with-html-output-to-string (s)
>>       (:texarea :name 'name  :type 'type val)))
>> "<texarea name='NAME' type='TYPE'></texarea>"
> 
> I think you have to change the use to something like:
> 
>  (:textarea :name 'name :type 'type (cl-who:str (princ-to-string
>  'value)))

PRINC-TO-STRING is unnecessary, cl-who:str knows how to deal with symbols 
already (though symbols in general are printed a bit ugly, as they get 
upcased).

Cheers,
Maciej
From: Alessio
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <12401ba0-b0fd-4c36-9f2b-a486a3fffe6f@w28g2000hsf.googlegroups.com>
In general, you can use

(cl-who:with-html-output-to-string (s)
  (your-print-function some-value s))

i.e. inside the body of cl-who:with-html-output-to-string, s is bound
to a stream you can write to, just like with-output-to-string.

cheers
Alessio
From: Slobodan Blazeski
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <46a073af-cbe1-4af5-ade3-7d1cb7811e77@b1g2000pra.googlegroups.com>
On Dec 10, 8:24 pm, Maciej Katafiasz <········@gmail.com> wrote:
> Den Mon, 10 Dec 2007 18:59:44 +0000 skrev Sohail Somani:
>
> >> (let ((val "value"))
> >>    (cl-who:with-html-output-to-string (s)
> >>       (:texarea :name 'name  :type 'type val)))
> >> "<texarea name='NAME' type='TYPE'></texarea>"
>
> > I think you have to change the use to something like:
>
> >  (:textarea :name 'name :type 'type (cl-who:str (princ-to-string
> >  'value)))
>
> PRINC-TO-STRING is unnecessary, cl-who:str knows how to deal with symbols
> already (though symbols in general are printed a bit ugly, as they get
> upcased).
>
> Cheers,
> Maciej

Well in my case that is  expected behaviour, thanks for noticing .
Thanks to everybody for their   advices.

Slobodan
From: Slobodan Blazeski
Subject: Re: cl-who:with-html-output-to-string question
Date: 
Message-ID: <edb7507b-5bcc-4338-9229-b5173ce921c1@l16g2000hsf.googlegroups.com>
Thanks to your help guys I finished my patch and added a small
tutorial at http://tourdelisp.blogspot.com/2007/12/adding-new-weblocks-type.html
if you have any comment of my code I will be happy to hear it.

cheers
Slobodan