From tayloj at rpi.edu Wed Jul 12 21:19:30 2006 From: tayloj at rpi.edu (Taylor, Joshua) Date: Wed, 12 Jul 2006 17:19:30 -0400 Subject: [cldoc-devel] use of format and intern in function generating macros Message-ID: <1c3ea73c0607121419m8fd8b2fv3f958eb660f7c779@mail.gmail.com> Hello CLDOC list, I've just recently checked out a copy CLDOC, and am quite pleased with the results I'm getting. At first, however, I was running into a slight bug, but one which is easy to fix. In several places in the code: cludg.lisp:186: (defun ,(intern (format nil "~a" s-purger)) (string) cludg.lisp:191: (defun ,(intern (format nil "~a" ll-purger)) (lambda-list) cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" s1 s2) pkg))) intern is being called with a string coming from format. In most Lisps this is not a problem, and in the one I use (Lispworks) the default settings would have no problem either. Out of personal preference however, I set *print-case* to :capitalize, which means that, e.g., (format nil "~a" s-purger) would give me "Purge-String-For-Html" and that the function defined was actually cldoc:|Purge-String-For-Html|. Fortunately the fix is easy: just change instances of (format nil "~a" sym) tp (symbol-name s-sym), and cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" s1 s2) pkg))) to cludg.lisp:618: (with-standard-io-syntax (intern (concatenate 'string (symbol-name s1) (symbol-name s2)) pkg))) although I'm not sure if it's necessary in that second case (as I don't know the context of that code). Once I got those purgers working, the HTML documentation is really beautiful. I'm very impressed with the project. Thanks for all your hard work! -- ===================== Joshua Taylor tayloj at rpi.edu From hatchond at free.fr Sat Jul 15 23:05:58 2006 From: hatchond at free.fr (Iban Hatchondo) Date: Sun, 16 Jul 2006 01:05:58 +0200 Subject: [cldoc-devel] use of format and intern in function generating macros In-Reply-To: <1c3ea73c0607121419m8fd8b2fv3f958eb660f7c779@mail.gmail.com> References: <1c3ea73c0607121419m8fd8b2fv3f958eb660f7c779@mail.gmail.com> Message-ID: <44B974D6.9080509@free.fr> Hi all, Thanks for reporting the bug. What about generalizing your solution and define something like: (defun cludg-intern (&rest parts) "Returns an interned symbol made from the concatenation of the given parts." (intern (apply #'concatenate 'string (mapcar #'string parts)))) that we would use instead of the those, three at least, (intern (format ..)) forms ? Joshua, can you confirm this fix the problem using your all favorite settings ? Kind regards, Iban. Taylor, Joshua wrote: > Hello CLDOC list, > > I've just recently checked out a copy CLDOC, and am quite pleased with the > results I'm getting. At first, however, I was running into a slight > bug, but one which > is easy to fix. > > In several places in the code: > > cludg.lisp:186: (defun ,(intern (format nil "~a" s-purger)) (string) > cludg.lisp:191: (defun ,(intern (format nil "~a" ll-purger)) > (lambda-list) > cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" > s1 s2) pkg))) > > intern is being called with a string coming from format. In most Lisps > this is not > a problem, and in the one I use (Lispworks) the default settings would > have no > problem either. Out of personal preference however, I set *print-case* to > :capitalize, which means that, e.g., (format nil "~a" s-purger) would > give me > "Purge-String-For-Html" and that the function defined was actually > cldoc:|Purge-String-For-Html|. > > Fortunately the fix is easy: just change instances of (format nil "~a" > sym) tp > (symbol-name s-sym), and > cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" > s1 s2) pkg))) > to > cludg.lisp:618: (with-standard-io-syntax (intern (concatenate 'string > (symbol-name s1) (symbol-name s2)) pkg))) > although I'm not sure if it's necessary in that second case (as I > don't know the context > of that code). > > Once I got those purgers working, the HTML documentation is really > beautiful. > I'm very impressed with the project. Thanks for all your hard work! ___________________________________________________________________________ Yahoo! Mail r?invente le mail ! D?couvrez le nouveau Yahoo! Mail et son interface r?volutionnaire. http://fr.mail.yahoo.com From hatchond at free.fr Mon Jul 17 14:34:06 2006 From: hatchond at free.fr (Iban Hatchondo) Date: Mon, 17 Jul 2006 16:34:06 +0200 Subject: [cldoc-devel] use of format and intern in function generating macros In-Reply-To: <44B974D6.9080509@free.fr> References: <1c3ea73c0607121419m8fd8b2fv3f958eb660f7c779@mail.gmail.com> <44B974D6.9080509@free.fr> Message-ID: <44BB9FDE.40002@free.fr> As mentioned by Joshua, I miss the pacakge argument in mk-fname. To handle it I would be tempted to suggest this: (defun cludg-mksym (&rest parts) "Returns a symbol name made from the concatenation of the given parts." (apply #'concatenate 'string (mapcar #'string parts))) (defun mk-fname (s1 s2 &aux (pkg (find-package-caseless *current-package*))) (with-standard-io-syntax (intern (cludg-mksym s1 s2) pkg))) and replace other intern forms by (intern (cludg-mksym ...)) Iban Hatchondo wrote: > Hi all, > > Thanks for reporting the bug. > > What about generalizing your solution and define something like: > > (defun cludg-intern (&rest parts) > "Returns an interned symbol made from the concatenation of the given > parts." > (intern (apply #'concatenate 'string (mapcar #'string parts)))) > > that we would use instead of the those, three at least, (intern (format > ..)) forms ? > > Joshua, can you confirm this fix the problem using your all favorite > settings ? > > > Kind regards, > Iban. > > > Taylor, Joshua wrote: > >> Hello CLDOC list, >> >> I've just recently checked out a copy CLDOC, and am quite pleased with >> the >> results I'm getting. At first, however, I was running into a slight >> bug, but one which >> is easy to fix. >> >> In several places in the code: >> >> cludg.lisp:186: (defun ,(intern (format nil "~a" s-purger)) >> (string) >> cludg.lisp:191: (defun ,(intern (format nil "~a" ll-purger)) >> (lambda-list) >> cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" >> s1 s2) pkg))) >> >> intern is being called with a string coming from format. In most Lisps >> this is not >> a problem, and in the one I use (Lispworks) the default settings would >> have no >> problem either. Out of personal preference however, I set *print-case* to >> :capitalize, which means that, e.g., (format nil "~a" s-purger) would >> give me >> "Purge-String-For-Html" and that the function defined was actually >> cldoc:|Purge-String-For-Html|. >> >> Fortunately the fix is easy: just change instances of (format nil "~a" >> sym) tp >> (symbol-name s-sym), and >> cludg.lisp:618: (with-standard-io-syntax (intern (format nil "~a~a" >> s1 s2) pkg))) >> to >> cludg.lisp:618: (with-standard-io-syntax (intern (concatenate 'string >> (symbol-name s1) (symbol-name s2)) pkg))) >> although I'm not sure if it's necessary in that second case (as I >> don't know the context >> of that code). >> >> Once I got those purgers working, the HTML documentation is really >> beautiful. >> I'm very impressed with the project. Thanks for all your hard work! > > > > > > > > ___________________________________________________________________________ > Yahoo! Mail r?invente le mail ! D?couvrez le nouveau Yahoo! Mail et son > interface r?volutionnaire. > http://fr.mail.yahoo.com > _______________________________________________ > cldoc-devel mailing list > cldoc-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cldoc-devel > > ___________________________________________________________________________ Yahoo! Mail r?invente le mail ! D?couvrez le nouveau Yahoo! Mail et son interface r?volutionnaire. http://fr.mail.yahoo.com