From iperminov at dwavesys.com Thu Dec 20 19:20:48 2007 From: iperminov at dwavesys.com (Ilya Perminov) Date: Thu, 20 Dec 2007 11:20:48 -0800 Subject: [log5-devel] Negation does not work in sender spec Message-ID: Hi, The following code gives "Variable BAR undefined" error: (defcategory foo) (defcategory bar) (start-sender 'console-log1 (stream-sender :location *error-output*) :category-spec (and foo (not bar)) :output-spec (category message)) I think the problem is in sender-responds-to-category-p. determine-category-variables returns two list, but sender-responds-to-category-p does not use the second one (negated variables). Regards, Ilya From gwking at metabang.com Sun Dec 23 00:20:14 2007 From: gwking at metabang.com (Gary King) Date: Sat, 22 Dec 2007 19:20:14 -0500 Subject: [log5-devel] Negation does not work in sender spec In-Reply-To: References: Message-ID: <5FE9AF9C-A389-49CF-8997-6C802256D152@metabang.com> Hi Iya, Thanks for pointing out this problem and given clues to the solution! I'll try to look into this this weekend and post an update. On Dec 20, 2007, at 2:20 PM, Ilya Perminov wrote: > Hi, > > The following code gives "Variable BAR undefined" error: > (defcategory foo) > (defcategory bar) > (start-sender 'console-log1 > (stream-sender :location *error-output*) > :category-spec (and foo (not bar)) > :output-spec (category message)) > > I think the problem is in sender-responds-to-category-p. > determine-category-variables returns two list, but > sender-responds-to-category-p does not use the second one > (negated variables). > > Regards, > Ilya > _______________________________________________ > log5-devel mailing list > log5-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/log5-devel -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From gwking at metabang.com Sun Dec 23 02:51:45 2007 From: gwking at metabang.com (Gary King) Date: Sat, 22 Dec 2007 21:51:45 -0500 Subject: [log5-devel] Negation does not work in sender spec In-Reply-To: References: Message-ID: <9FFADD1C-DD0C-460D-B01F-8A906BE448C6@metabang.com> Hi Ilya, Thanks again for pointing out this problem; I've corrected the bug and rolled out 0.3.1. One perhaps surprising / perhaps wrong thing is outlined in this test: > (addtest (test-negated-categories) > start-sender > (let ((string > (with-output-to-string (stream) > (start-sender-fn 'test-negated-categories > '(and nc-foo (not nc-bar)) '(message) > 'stream-sender :location stream) > (log-for (nc-foo) "absence is negation?") > (log-for (nc-bar) "no") > (log-for (nc-foo (not nc-bar)) "yes") > (log-for (and (not nc-foo) (not nc-bar)) "no") > ))) > (ensure-same string > (format nil "\"absence is negation?\"~&\"yes\"") > :test 'string=))) The output of the bottom three `log-for` commands is, I think, unobjectionable. The question is what it should do in the `(log-for (nc-foo)` case. Currently, log5 treats the absence of category _as_ negation and so the command outputs the message. It might be better to have a sort-of three-valued logic that incorporated missings but it's not immediately clear that this actually useful or conceptually simple! If you have any opinions, please me know. On Dec 20, 2007, at 2:20 PM, Ilya Perminov wrote: > Hi, > > The following code gives "Variable BAR undefined" error: > (defcategory foo) > (defcategory bar) > (start-sender 'console-log1 > (stream-sender :location *error-output*) > :category-spec (and foo (not bar)) > :output-spec (category message)) > > I think the problem is in sender-responds-to-category-p. > determine-category-variables returns two list, but > sender-responds-to-category-p does not use the second one > (negated variables). > > Regards, > Ilya > _______________________________________________ > log5-devel mailing list > log5-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/log5-devel -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM