From fbogdanovic at xnet.hr Mon Apr 9 22:38:01 2012 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Tue, 10 Apr 2012 00:38:01 +0200 Subject: [cl-who-devel] onclick Message-ID: <2675FBF8A3B349308B91CDD46ACFCA78@komp> Hi. Why doesn't this piece of code work: (defpackage test (:use :cl :hunchentoot :cl-who :parenscript)) (in-package test) (defun index () (with-html-output-to-string (*standard-output* nil) (:html (:head) (:body (:p "click me" :onclick (ps (alert "hello"))))))) (push (create-prefix-dispatcher "/index" 'index) *dispatch-table*) (start (make-instance 'easy-acceptor)) I loaded Edi's init file for Lispworks and I can't even autocomplete :onclick ? When I click on "click me" nothing happens ? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From fbogdanovic at xnet.hr Thu Apr 12 10:52:11 2012 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Thu, 12 Apr 2012 12:52:11 +0200 Subject: [cl-who-devel] onclick Message-ID: I installed all the libraries (cl-who, parenscript and hunchentoot) properlly with the latest quicklisp but I can't still autocomplete :onclick. If I just write it the program stilll doesn't work. What could be the problem ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stassats at gmail.com Thu Apr 12 14:45:03 2012 From: stassats at gmail.com (Stas Boukarev) Date: Thu, 12 Apr 2012 18:45:03 +0400 Subject: [cl-who-devel] onclick References: Message-ID: <871untggb4.fsf@gmail.com> "Haris Bogdanovich" writes: > I installed all the libraries (cl-who, parenscript and hunchentoot) properlly > with the latest quicklisp but I can't still autocomplete :onclick. You shouldn't be able to autocomplete :onclick. Autocomplete in slime works only for interned symbols, once you compile the code it will be interned and you would see it in the autocompletion. cl-who doesn't intern symbols into keyword for it to work. > If I just write it the program stilll doesn't work. > What could be the problem ? :onclick should come before the body of

, so, (with-html-output-to-string (*standard-output* nil) (:html (:head) (:body (:p :onclick "alert(\"Hello\")" "click me")))) I don't know how parenscript is supposed to work, but (ps (alert "hello")) returns "alert('hello');", and cl-who uses #\' to quote strings, so it becomes 'alert('hello');', which obviously doesn't work. -- With best regards, Stas. From stassats at gmail.com Thu Apr 12 14:47:32 2012 From: stassats at gmail.com (Stas Boukarev) Date: Thu, 12 Apr 2012 18:47:32 +0400 Subject: [cl-who-devel] onclick In-Reply-To: <871untggb4.fsf@gmail.com> (Stas Boukarev's message of "Thu, 12 Apr 2012 18:45:03 +0400") References: <871untggb4.fsf@gmail.com> Message-ID: <87ty0pf1mj.fsf@gmail.com> Stas Boukarev writes: > "Haris Bogdanovich" writes: > >> I installed all the libraries (cl-who, parenscript and hunchentoot) properlly >> with the latest quicklisp but I can't still autocomplete :onclick. > You shouldn't be able to autocomplete :onclick. Autocomplete in slime > works only for interned symbols, once you compile the code it will be > interned and you would see it in the autocompletion. cl-who doesn't > intern symbols into keyword for it to work. > >> If I just write it the program stilll doesn't work. >> What could be the problem ? > :onclick should come before the body of

, so, > > (with-html-output-to-string (*standard-output* nil) > (:html > (:head) > (:body > (:p :onclick "alert(\"Hello\")" > "click me")))) > > I don't know how parenscript is supposed to work, but (ps (alert > "hello")) returns "alert('hello');", and cl-who uses #\' to quote > strings, so it becomes 'alert('hello');', which obviously doesn't work. (setf ps:*js-string-delimiter* #\") for (:p :onclick (ps (alert "hello")) "click me") to work. -- With best regards, Stas. From andy.arvid at gmail.com Thu Apr 12 15:55:13 2012 From: andy.arvid at gmail.com (Andy Peterson) Date: Thu, 12 Apr 2012 11:55:13 -0400 Subject: [cl-who-devel] onclick In-Reply-To: <87ty0pf1mj.fsf@gmail.com> References: <871untggb4.fsf@gmail.com> <87ty0pf1mj.fsf@gmail.com> Message-ID: On Thu, Apr 12, 2012 at 10:47 AM, Stas Boukarev wrote: > > Stas Boukarev writes: > > > "Haris Bogdanovich" writes: > > > >> I installed all the libraries (cl-who, parenscript and hunchentoot) properlly > >> with the latest quicklisp but I can't still autocomplete :onclick. > > You shouldn't be able to autocomplete :onclick. Autocomplete in slime > > works only for interned symbols, once you compile the code it will be > > interned and you would see it in the autocompletion. cl-who doesn't > > intern symbols into keyword for it to work. > > > >> If I just write it the program stilll doesn't work. > >> What could be the problem ? > > :onclick should come before the body of

, so, > > > > (with-html-output-to-string (*standard-output* nil) > > ? ? (:html > > ? ? ?(:head) > > ? ? ?(:body > > ? ? ? (:p :onclick "alert(\"Hello\")" > > ? ? ? ? ? "click me")))) > > > > I don't know how parenscript is supposed to work, but (ps (alert > > "hello")) returns "alert('hello');", and cl-who uses #\' to quote > > strings, so it becomes 'alert('hello');', which obviously doesn't work. > > (setf ps:*js-string-delimiter* #\") for > > (:p :onclick (ps (alert "hello")) "click me") > > to work. > > -- > With best regards, Stas. > >From the parenscript manual: (PS-INLINE form &optional *JS-STRING-DELIMITER*) (PS-INLINE* form &optional *JS-STRING-DELIMITER*) PS-INLINE?and?PS-INLINE*?take a single Parenscript form and output a string starting with?javascript:?that can be used in HTML node attributes. As well, they provide an argument to bind the value of *JS-STRING-DELIMITER*?to control the value of the JavaScript string escape character to be compatible with whatever the HTML generation mechanism is used (for example, if HTML strings are delimited using #\', using?#\"?will avoid conflicts without requiring the output JavaScript code to be escaped). By default the value is taken from *JS-INLINE-STRING-DELIMITER*. comment: the default value for ?*JS-INLINE-STRING-DELIMITER* is #\" From amalawi at gmail.com Thu Apr 19 20:42:37 2012 From: amalawi at gmail.com (Ala'a Mohammad) Date: Fri, 20 Apr 2012 00:42:37 +0400 Subject: [cl-who-devel] declarations placement issue Message-ID: Hi, Please, correct me If I'm wrong. in the expansion of the following (using cl-who from quicklisp) (with-html-output (var) (declare (special var))) ;=> (LET ((VAR VAR)) (PROGN (DECLARE (SPECIAL VAR)))) I think that the declaration is placed in the wrong place. CLHS does not specify any declarations for PROGN entry. and in this declaration provides information about the bindings of LET, thus I thought the correct expansion should be: (with-html-output (var) (declare (special var))) ;=> (LET ((VAR VAR)) (DECLARE (SPECIAL VAR)) (PROGN)) the fix should should only affect with-html-output (since with-html-output-to-string passes the declarations to the former macro) Regards, Ala'a