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
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
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
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
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
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