From rlpowell at digitalkingdom.org Tue Sep 2 20:37:46 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Tue, 2 Sep 2008 13:37:46 -0700 Subject: [heresy-devel] null/ bug. Message-ID: <20080902203746.GF30355@digitalkingdom.org> IMO, membership predicates should never except, but: * (null/ 'e) debugger invoked on a SB-KERNEL:CASE-FAILURE in thread #: E fell through ETYPECASE expression. Wanted one of (LAZY-LIST HERESY::LAZY-LIST-KNOWN-EMPTY HERESY::LAZY-LIST-LIST-BASED SEQUENCE LIST). -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From rlpowell at digitalkingdom.org Tue Sep 2 23:15:34 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Tue, 2 Sep 2008 16:15:34 -0700 Subject: [heresy-devel] null/ bug. In-Reply-To: <20080902203746.GF30355@digitalkingdom.org> References: <20080902203746.GF30355@digitalkingdom.org> Message-ID: <20080902231534.GM30355@digitalkingdom.org> On Tue, Sep 02, 2008 at 01:37:46PM -0700, Robin Lee Powell wrote: > > IMO, membership predicates should never except, but: > > * (null/ 'e) > > debugger invoked on a SB-KERNEL:CASE-FAILURE in thread # "initial thread" RUNNING {100266AC71}>: E fell through ETYPECASE > expression. Wanted one of (LAZY-LIST HERESY::LAZY-LIST-KNOWN-EMPTY > HERESY::LAZY-LIST-LIST-BASED SEQUENCE LIST). This turns out to be a more serious problem than I thought; (atom (list/ )) returns t, so the obvious fix of (or (atom x) (non-null/ x)) doesn't work. On top of that, the "is a lazy list" predicate doesn't seem to be exported from Heresy. I had to add (atom nil) to the etypecase for null/, but really I think that should be a typecase with (t nil) at the end. -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From matthew.lamari at gmail.com Tue Sep 2 23:38:47 2008 From: matthew.lamari at gmail.com (Matt Lamari) Date: Tue, 02 Sep 2008 18:38:47 -0500 Subject: [heresy-devel] null/ bug. In-Reply-To: <20080902231534.GM30355@digitalkingdom.org> References: <20080902203746.GF30355@digitalkingdom.org> <20080902231534.GM30355@digitalkingdom.org> Message-ID: <48BDCE87.4070704@gmail.com> Would this do the job? Basically adding null and "t" types to the typecase. . . Or am I missing a problem here (defun null/ (list) "Returns nil if list has contents, a value otherwise. Will only traverse a single element for lazy-lists" (etypecase list (null t) (list (null list)) (sequence (zerop (length list))) (lazy-list-list-based (null (get-list-head list))) (lazy-list-known-empty t) (lazy-list (with-traversal-result (value next) (resolved (get-traversal-result (get-call-for-first list))) (not (resolved next)))) (t nil))) Robin Lee Powell wrote: > On Tue, Sep 02, 2008 at 01:37:46PM -0700, Robin Lee Powell wrote: > >> IMO, membership predicates should never except, but: >> >> * (null/ 'e) >> >> debugger invoked on a SB-KERNEL:CASE-FAILURE in thread #> "initial thread" RUNNING {100266AC71}>: E fell through ETYPECASE >> expression. Wanted one of (LAZY-LIST HERESY::LAZY-LIST-KNOWN-EMPTY >> HERESY::LAZY-LIST-LIST-BASED SEQUENCE LIST). >> > > This turns out to be a more serious problem than I thought; > > (atom (list/ )) > > returns t, so the obvious fix of > > (or (atom x) (non-null/ x)) > > doesn't work. On top of that, the "is a lazy list" predicate > doesn't seem to be exported from Heresy. I had to add (atom nil) to > the etypecase for null/, but really I think that should be a > typecase with (t nil) at the end. > > -Robin > > From rlpowell at digitalkingdom.org Tue Sep 2 23:50:34 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Tue, 2 Sep 2008 16:50:34 -0700 Subject: [heresy-devel] null/ bug. In-Reply-To: <48BDCE87.4070704@gmail.com> References: <20080902203746.GF30355@digitalkingdom.org> <20080902231534.GM30355@digitalkingdom.org> <48BDCE87.4070704@gmail.com> Message-ID: <20080902235034.GN30355@digitalkingdom.org> That seems to work just fine. Thanks! -Robin On Tue, Sep 02, 2008 at 06:38:47PM -0500, Matt Lamari wrote: > > Would this do the job? Basically adding null and "t" types to the > typecase. . . Or am I missing a problem here > > (defun null/ (list) > "Returns nil if list has contents, a value otherwise. Will only > traverse a single element for lazy-lists" > (etypecase list > (null t) > (list (null list)) > (sequence (zerop (length list))) > (lazy-list-list-based (null (get-list-head list))) > (lazy-list-known-empty t) > (lazy-list (with-traversal-result (value next) (resolved > (get-traversal-result (get-call-for-first list))) (not (resolved next)))) > (t nil))) > > Robin Lee Powell wrote: >> On Tue, Sep 02, 2008 at 01:37:46PM -0700, Robin Lee Powell wrote: >> >>> IMO, membership predicates should never except, but: >>> >>> * (null/ 'e) >>> >>> debugger invoked on a SB-KERNEL:CASE-FAILURE in thread #>> "initial thread" RUNNING {100266AC71}>: E fell through ETYPECASE >>> expression. Wanted one of (LAZY-LIST HERESY::LAZY-LIST-KNOWN-EMPTY >>> HERESY::LAZY-LIST-LIST-BASED SEQUENCE LIST). >>> >> >> This turns out to be a more serious problem than I thought; >> >> (atom (list/ )) >> >> returns t, so the obvious fix of >> >> (or (atom x) (non-null/ x)) >> >> doesn't work. On top of that, the "is a lazy list" predicate >> doesn't seem to be exported from Heresy. I had to add (atom nil) to >> the etypecase for null/, but really I think that should be a >> typecase with (t nil) at the end. >> >> -Robin >> >> > -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From rlpowell at digitalkingdom.org Wed Sep 3 22:17:09 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Wed, 3 Sep 2008 15:17:09 -0700 Subject: [heresy-devel] lazy-listp? Message-ID: <20080903221709.GA31598@digitalkingdom.org> Does the Heresy library export any way to test if something is a lazy list? If not, could it? -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From matthew.lamari at gmail.com Thu Sep 4 01:44:16 2008 From: matthew.lamari at gmail.com (Matt Lamari) Date: Wed, 03 Sep 2008 20:44:16 -0500 Subject: [heresy-devel] lazy-listp? In-Reply-To: <20080903221709.GA31598@digitalkingdom.org> References: <20080903221709.GA31598@digitalkingdom.org> Message-ID: <48BF3D70.7040207@gmail.com> I am inclined toward listp/ - and have it trigger off of listp AND lazy-lists. (Given that almost all the other calls will accept sequences and lazy-lists) Sound good? Robin Lee Powell wrote: > Does the Heresy library export any way to test if something is a > lazy list? If not, could it? > > -Robin > > From rlpowell at digitalkingdom.org Thu Sep 4 05:25:04 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Wed, 3 Sep 2008 22:25:04 -0700 Subject: [heresy-devel] lazy-listp? In-Reply-To: <48BF3D70.7040207@gmail.com> References: <20080903221709.GA31598@digitalkingdom.org> <48BF3D70.7040207@gmail.com> Message-ID: <20080904052504.GC31598@digitalkingdom.org> I was thinking one of each: (defun listp/ (list) (typecase list (lazy-list-list-based t) (lazy-list-pair-based t) (lazy-list t) (list t) (t nil))) (defun lazy-listp (list) (typecase list (lazy-list-list-based t) (lazy-list-pair-based t) (lazy-list t) (t nil))) BTW, the version you gave me seems to be quite a bit different (as judged by diff -w -r) than the version currently on sourceforge; which one's more recent? -Robin On Wed, Sep 03, 2008 at 08:44:16PM -0500, Matt Lamari wrote: > I am inclined toward listp/ - and have it trigger off of listp AND > lazy-lists. > > (Given that almost all the other calls will accept sequences and > lazy-lists) > > Sound good? > > > Robin Lee Powell wrote: >> Does the Heresy library export any way to test if something is a >> lazy list? If not, could it? >> >> -Robin >> >> > -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From matthew.lamari at gmail.com Thu Sep 4 05:50:41 2008 From: matthew.lamari at gmail.com (Matt Lamari) Date: Thu, 04 Sep 2008 00:50:41 -0500 Subject: [heresy-devel] lazy-listp? In-Reply-To: <20080904052504.GC31598@digitalkingdom.org> References: <20080903221709.GA31598@digitalkingdom.org> <48BF3D70.7040207@gmail.com> <20080904052504.GC31598@digitalkingdom.org> Message-ID: <48BF7731.4090303@gmail.com> I'm about to publish a new version. I'll add lazy-listp as well. The one on Sourceforge is a fair bit older than the one you have - what you have now is similar to my next deployment. Robin Lee Powell wrote: > I was thinking one of each: > > (defun listp/ (list) > (typecase list > (lazy-list-list-based t) > (lazy-list-pair-based t) > (lazy-list t) > (list t) > (t nil))) > > (defun lazy-listp (list) > (typecase list > (lazy-list-list-based t) > (lazy-list-pair-based t) > (lazy-list t) > (t nil))) > > BTW, the version you gave me seems to be quite a bit different (as > judged by diff -w -r) than the version currently on sourceforge; > which one's more recent? > > -Robin > > On Wed, Sep 03, 2008 at 08:44:16PM -0500, Matt Lamari wrote: > >> I am inclined toward listp/ - and have it trigger off of listp AND >> lazy-lists. >> >> (Given that almost all the other calls will accept sequences and >> lazy-lists) >> >> Sound good? >> >> >> Robin Lee Powell wrote: >> >>> Does the Heresy library export any way to test if something is a >>> lazy list? If not, could it? >>> >>> -Robin >>> >>> >>> > > From matthew.lamari at gmail.com Thu Sep 4 06:30:00 2008 From: matthew.lamari at gmail.com (Matt Lamari) Date: Thu, 04 Sep 2008 01:30:00 -0500 Subject: [heresy-devel] Heresy_0_0_4 published and ASDF-installable Message-ID: <48BF8068.4010101@gmail.com> I got a linux 64/SBCL and got it to work, and made it ASDF-installable (I'm a LW/Win32 user, hence the outstanding issues) That the unit-tester happens to recompile (to test some compiler-macros) makes running the unit-test particularly painful. Tons of style warnings (most are repeats of the "sink-count" one) the CSV test seems to have failed - there will be another revision within the week to clean this up; but hopefully this makes the library a bit more accessible. From rlpowell at digitalkingdom.org Thu Sep 4 19:39:18 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Thu, 4 Sep 2008 12:39:18 -0700 Subject: [heresy-devel] Heresy_0_0_4 published and ASDF-installable In-Reply-To: <48BF8068.4010101@gmail.com> References: <48BF8068.4010101@gmail.com> Message-ID: <20080904193918.GJ31598@digitalkingdom.org> On Thu, Sep 04, 2008 at 01:30:00AM -0500, Matt Lamari wrote: > > I got a linux 64/SBCL and got it to work, and made it > ASDF-installable (I'm a LW/Win32 user, hence the outstanding > issues) Only one problem: the perms are *way* off. All files have no permissions at all, including the directory. I don't know how to fix this with whatever tar app you are using, but if you tell me what it is I can try to figure it out. Other than that, and that it still runs the unit tests on every (require 'heresy), it's fine. Thanks! -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From rlpowell at digitalkingdom.org Fri Sep 5 00:59:24 2008 From: rlpowell at digitalkingdom.org (Robin Lee Powell) Date: Thu, 4 Sep 2008 17:59:24 -0700 Subject: [heresy-devel] Equality testing. Message-ID: <20080905005924.GR31598@digitalkingdom.org> * (equal (LIST/ 'B 'A 'Q '(C 1)) (LIST/ 'B 'A 'Q '(C 1))) NIL So, umm, how do I do that? Convert to a regular list first? -Robin -- Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo Proud Supporter of the Singularity Institute - http://singinst.org/ http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ From matthew.lamari at gmail.com Fri Sep 5 21:08:52 2008 From: matthew.lamari at gmail.com (Matt Lamari) Date: Fri, 05 Sep 2008 16:08:52 -0500 Subject: [heresy-devel] Equality testing. In-Reply-To: <20080905005924.GR31598@digitalkingdom.org> References: <20080905005924.GR31598@digitalkingdom.org> Message-ID: <48C19FE4.2010105@gmail.com> (note - has to be read in heresy namespace, i.e. add it to the file) I believe it works correctly with sub-lists too. Also note - consumes stack - when I get time I'll rewrite it in continuation-calling form. It does not consume stack based on list "length"; but on list-of-list depth. I'll also optimize it better for speed (expand out/not use those readpoints and their performance hit). (defun equal/ (a b) (let ((infinite (iterate/ #'identity nil)) (end (cons nil nil)) (a-is-list (listp/ a)) (b-is-list (listp/ b))) (cond ((and a-is-list b-is-list) (let ((a (read-point-built (to-lazy-list a))) (b (read-point-built (to-lazy-list b)))) (unless (loop while not (or (read-point-at-end a) (read-point-at-end b)) do (unless (equal/ (read-point-value a) (read-point-value b)) (return-from nil t)) (setq a (read-point-advanced a)) (setq b (read-point-advanced b))) (not (or (read-point-at-end a) (read-point-at-end b)))))) ((or a-is-list b-is-list) nil) (t (equal a b))))) Robin Lee Powell wrote: > * (equal (LIST/ 'B 'A 'Q '(C 1)) (LIST/ 'B 'A 'Q '(C 1))) > NIL > > So, umm, how do I do that? Convert to a regular list first? > > -Robin > >