From michael at mudge.com Sat Jun 7 00:08:52 2003 From: michael at mudge.com (michael@mudge.com) Date: Sat Jun 7 00:08:31 2003 Subject: [Coldstuff] Two bugs Message-ID: <20030606230852.21978.h005.c000.wm@mail.mudge.com.criticalpath.net> Just noticed a strange behavior of fromliteral()... When given a nonexistent objname, it returns the next objnum... ;fromliteral("$adaaefewj") => #2043516 Also caller().(calling_method())() ought to *always* point to an existing method (that hasn't self-destructed), however, since caller() is stored in the task frame and calling_method() is not, they behave differently during pass() and method fork. Can a driver change be made to store calling_method() in the task frame as well, so they're always in sync? Squeaky Wheel, - Kipp From brandon at roguetrader.com Tue Jun 10 22:20:56 2003 From: brandon at roguetrader.com (Brandon Gillespie) Date: Tue Jun 10 21:20:50 2003 Subject: [Coldstuff] another bug Message-ID: <3EE6A018.9000400@roguetrader.com> Since we are on the topic... ;`[13,10] in `[] => -1 (should be => 0) And it is only with empty buffers. Doing: ;`[13,10] in `[0] => 0 From cynewulf at usit.net Wed Jun 11 01:53:07 2003 From: cynewulf at usit.net (Allen Noe) Date: Tue Jun 10 22:51:30 2003 Subject: [Coldstuff] another bug References: <3EE6A018.9000400@roguetrader.com> Message-ID: <3EE6B5B3.2B1120FD@usit.net> Brandon Gillespie wrote: > > Since we are on the topic... > > ;`[13,10] in `[] > => -1 I have a patch for this one, guess I forgot to post it. If I remember correctly, I forgot that buffer_index can return F_FAILURE when I merged buf in buf and bufidx. Patch has a testcase for `[10, 13] in `[], and is pretty well-tested, it's been applied and running on Kipp's server for a while. -------------- next part -------------- diff -ur Genesis-1.1.11-STABLE/src/ops/operators.c Genesis-bufinbuf/src/ops/operators.c --- Genesis-1.1.11-STABLE/src/ops/operators.c 2002-06-28 23:45:41.000000000 -0400 +++ Genesis-bufinbuf/src/ops/operators.c 2002-10-26 20:37:02.000000000 -0400 @@ -2275,7 +2275,10 @@ uchar * ss = d1->u.buffer->s; int slen = d1->u.buffer->len; - pos = buffer_index(buf, ss, slen, 1) - 1; + pos = buffer_index(buf, ss, slen, 1); + if (pos == F_FAILURE) pos = 0; + + pos--; } else goto error; diff -ur Genesis-1.1.11-STABLE/test/test.in Genesis-bufinbuf/test/test.in --- Genesis-1.1.11-STABLE/test/test.in 2002-06-28 23:45:41.000000000 -0400 +++ Genesis-bufinbuf/test/test.in 2002-10-26 20:40:35.000000000 -0400 @@ -685,6 +685,7 @@ "bc" in "llama" ==> 0 4 in 'foo ==> ~type `[10, 13] in `[10, 10] ==> 0 + `[10, 13] in `[] ==> 0 Logic 1 && 1 ==> 1 1 && 0 ==> 0 @@ -777,6 +778,7 @@ dblog(" \"bc\" in \"llama\" ==> " + toliteral("bc" in "llama")); dblog(" 4 in 'foo ==> " + toliteral((| 4 in 'foo |))); dblog(" `[10, 13] in `[10, 10] ==> " + toliteral((| `[10, 13] in `[10, 10] |))); + dblog(" `[10, 13] in `[] ==> " + toliteral((| `[10, 13] in `[] |))); dblog(" Logic"); dblog(" 1 && 1 ==> " + toliteral(1 && 1)); dblog(" 1 && 0 ==> " + toliteral(1 && 0)); From braddr at puremagic.com Tue Jun 10 23:03:46 2003 From: braddr at puremagic.com (Brad Roberts) Date: Tue Jun 10 23:03:18 2003 Subject: [Coldstuff] another bug In-Reply-To: <3EE6B5B3.2B1120FD@usit.net> Message-ID: Any objections to making it throw ~range instead? Index: src/ops/buffer.c =================================================================== RCS file: /cvsroot/cold/genesis/src/ops/buffer.c,v retrieving revision 1.8 diff -u -r1.8 buffer.c --- src/ops/buffer.c 7 Jan 2001 00:45:05 -0000 1.8 +++ src/ops/buffer.c 11 Jun 2003 05:00:19 -0000 @@ -194,12 +194,6 @@ } else THROW((type_id, "Second argument must be a buffer or integer.")) - if (!buffer_len(BUF1)) { - pop(argc); - push_int(0); - return; - } - if ((r = buffer_index(BUF1, cp, clen, origin)) == F_FAILURE) THROW((range_id, "Origin is beyond the range of the buffer.")) Index: src/ops/operators.c =================================================================== RCS file: /cvsroot/cold/genesis/src/ops/operators.c,v retrieving revision 1.20.6.1 diff -u -r1.20.6.1 operators.c --- src/ops/operators.c 24 May 2002 05:17:12 -0000 1.20.6.1 +++ src/ops/operators.c 11 Jun 2003 05:00:19 -0000 @@ -2275,7 +2275,12 @@ uchar * ss = d1->u.buffer->s; int slen = d1->u.buffer->len; - pos = buffer_index(buf, ss, slen, 1) - 1; + if ((pos = buffer_index(buf, ss, slen, 1)) == F_FAILURE) { + cthrow(range_id, "Origin is beyond the range of the buffer."); + return; + } + else + pos--; } else goto error; Index: test/test.in =================================================================== RCS file: /cvsroot/cold/genesis/test/test.in,v retrieving revision 1.2.4.3 diff -u -r1.2.4.3 test.in --- test/test.in 24 May 2002 06:38:27 -0000 1.2.4.3 +++ test/test.in 11 Jun 2003 05:00:19 -0000 @@ -684,7 +684,10 @@ "am" in "llama" ==> 3 "bc" in "llama" ==> 0 4 in 'foo ==> ~type + `[10, 13] in `[10, 13] ==> 1 `[10, 13] in `[10, 10] ==> 0 + `[10, 13] in `[0] ==> 0 + `[10, 13] in `[] ==> ~range Logic 1 && 1 ==> 1 1 && 0 ==> 0 @@ -776,7 +779,10 @@ dblog(" \"am\" in \"llama\" ==> " + toliteral("am" in "llama")); dblog(" \"bc\" in \"llama\" ==> " + toliteral("bc" in "llama")); dblog(" 4 in 'foo ==> " + toliteral((| 4 in 'foo |))); + dblog(" `[10, 13] in `[10, 13] ==> " + toliteral((| `[10, 13] in `[10, 13] |))); dblog(" `[10, 13] in `[10, 10] ==> " + toliteral((| `[10, 13] in `[10, 10] |))); + dblog(" `[10, 13] in `[0] ==> " + toliteral((| `[10, 13] in `[0] |))); + dblog(" `[10, 13] in `[] ==> " + toliteral((| `[10, 13] in `[] |))); dblog(" Logic"); dblog(" 1 && 1 ==> " + toliteral(1 && 1)); dblog(" 1 && 0 ==> " + toliteral(1 && 0)); @@ -1535,7 +1541,10 @@ `[1, 2, 3, 4, 5, 5], 5, 7 -> ~range 1 `[1, 2, 3, 4, 5, 5], 5, -7 -> ~range 2 `[0, 0, 97, 0, 0, 98, 92, 65, 99], `[92, 65], 6 -> 7 - + `[10, 13], `[10, 13] -> 1 + `[10, 10], `[10, 13] -> 0 + `[0], `[10, 13] -> 0 + `[], `[10, 13] -> ~range eval { var a, b; @@ -1558,6 +1567,14 @@ b = `[92, 65]; dblog(" " + toliteral(a) + ", " + b + ", 6 -> " + toliteral((| bufidx(a, b, 6) |))); + + a = `[10, 13]; + + dblog(" `[10, 13], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 13], a) |))); + dblog(" `[10, 10], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 10], a) |))); + dblog(" `[0], " + toliteral(a) + " -> " + toliteral((| bufidx(`[0], a) |))); + dblog(" `[], " + toliteral(a) + " -> " + toliteral((| bufidx(`[], a) |))); + }; // Buffer test 7 On Wed, 11 Jun 2003, Allen Noe wrote: > Date: Wed, 11 Jun 2003 00:53:07 -0400 > From: Allen Noe > Reply-To: coldstuff@cold.org > To: coldstuff@cold.org > Subject: Re: [Coldstuff] another bug > > Brandon Gillespie wrote: > > > > Since we are on the topic... > > > > ;`[13,10] in `[] > > => -1 > > I have a patch for this one, guess I forgot to post it. If I remember > correctly, I forgot that buffer_index can return F_FAILURE when I merged > buf in buf and bufidx. Patch has a testcase for `[10, 13] in `[], and is > pretty well-tested, it's been applied and running on Kipp's server for a > while. From brandon at roguetrader.com Wed Jun 11 09:24:31 2003 From: brandon at roguetrader.com (Brandon Gillespie) Date: Wed Jun 11 08:24:08 2003 Subject: [Coldstuff] another bug In-Reply-To: References: Message-ID: <3EE73B9F.2060505@roguetrader.com> Brad Roberts wrote: > Any objections to making it throw ~range instead? Yeah actually :) None of the other data types throw range in the similar situation, and code presumes it will just return 0 all over the place: "asdf" in "" => 0 [1,2,3] in [] => 0 So basically, current indexing on other data types already establishes the norm of returning 0 in that case, which is Ok imho, since "asdf" not being in "" is no different than "asdf" not being in "jackalope". -Brandon From braddr at puremagic.com Wed Jun 11 13:51:56 2003 From: braddr at puremagic.com (Brad Roberts) Date: Wed Jun 11 13:51:28 2003 Subject: [Coldstuff] another bug In-Reply-To: <3EE73B9F.2060505@roguetrader.com> Message-ID: Ok.. I ws expecting that argument, just felt like proposing it to see what the responses were. Here's my current diff, almost the same as Allen's, with a few more tests, including one for string indexing. Index: src/ops/operators.c =================================================================== RCS file: /cvsroot/cold/genesis/src/ops/operators.c,v retrieving revision 1.20.6.1 diff -u -r1.20.6.1 operators.c --- src/ops/operators.c 24 May 2002 05:17:12 -0000 1.20.6.1 +++ src/ops/operators.c 11 Jun 2003 19:08:53 -0000 @@ -2275,7 +2275,8 @@ uchar * ss = d1->u.buffer->s; int slen = d1->u.buffer->len; - pos = buffer_index(buf, ss, slen, 1) - 1; + if ((pos = buffer_index(buf, ss, slen, 1)) != F_FAILURE) + pos--; } else goto error; Index: test/test.in =================================================================== RCS file: /cvsroot/cold/genesis/test/test.in,v retrieving revision 1.2.4.3 diff -u -r1.2.4.3 test.in --- test/test.in 24 May 2002 06:38:27 -0000 1.2.4.3 +++ test/test.in 11 Jun 2003 19:08:53 -0000 @@ -683,8 +683,12 @@ "a" in "cab" ==> 2 "am" in "llama" ==> 3 "bc" in "llama" ==> 0 + "" in "llama" ==> 0 4 in 'foo ==> ~type + `[10, 13] in `[10, 13] ==> 1 `[10, 13] in `[10, 10] ==> 0 + `[10, 13] in `[0] ==> 0 + `[10, 13] in `[] ==> 0 Logic 1 && 1 ==> 1 1 && 0 ==> 0 @@ -775,8 +779,12 @@ dblog(" \"a\" in \"cab\" ==> " + toliteral("a" in "cab")); dblog(" \"am\" in \"llama\" ==> " + toliteral("am" in "llama")); dblog(" \"bc\" in \"llama\" ==> " + toliteral("bc" in "llama")); + dblog(" \"\" in \"llama\" ==> " + toliteral("" in "llama")); dblog(" 4 in 'foo ==> " + toliteral((| 4 in 'foo |))); + dblog(" `[10, 13] in `[10, 13] ==> " + toliteral((| `[10, 13] in `[10, 13] |))); dblog(" `[10, 13] in `[10, 10] ==> " + toliteral((| `[10, 13] in `[10, 10] |))); + dblog(" `[10, 13] in `[0] ==> " + toliteral((| `[10, 13] in `[0] |))); + dblog(" `[10, 13] in `[] ==> " + toliteral((| `[10, 13] in `[] |))); dblog(" Logic"); dblog(" 1 && 1 ==> " + toliteral(1 && 1)); dblog(" 1 && 0 ==> " + toliteral(1 && 0)); @@ -1535,7 +1543,10 @@ `[1, 2, 3, 4, 5, 5], 5, 7 -> ~range 1 `[1, 2, 3, 4, 5, 5], 5, -7 -> ~range 2 `[0, 0, 97, 0, 0, 98, 92, 65, 99], `[92, 65], 6 -> 7 - + `[10, 13], `[10, 13] -> 1 + `[10, 10], `[10, 13] -> 0 + `[0], `[10, 13] -> 0 + `[], `[10, 13] -> 0 eval { var a, b; @@ -1558,6 +1569,14 @@ b = `[92, 65]; dblog(" " + toliteral(a) + ", " + b + ", 6 -> " + toliteral((| bufidx(a, b, 6) |))); + + a = `[10, 13]; + + dblog(" `[10, 13], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 13], a) |))); + dblog(" `[10, 10], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 10], a) |))); + dblog(" `[0], " + toliteral(a) + " -> " + toliteral((| bufidx(`[0], a) |))); + dblog(" `[], " + toliteral(a) + " -> " + toliteral((| bufidx(`[], a) |))); + }; // Buffer test 7 On Wed, 11 Jun 2003, Brandon Gillespie wrote: > Date: Wed, 11 Jun 2003 08:24:31 -0600 > From: Brandon Gillespie > Reply-To: coldstuff@cold.org > To: coldstuff@cold.org > Subject: Re: [Coldstuff] another bug > > Brad Roberts wrote: > > Any objections to making it throw ~range instead? > > Yeah actually :) > > None of the other data types throw range in the similar situation, and > code presumes it will just return 0 all over the place: > > "asdf" in "" > => 0 > [1,2,3] in [] > => 0 > > So basically, current indexing on other data types already establishes > the norm of returning 0 in that case, which is Ok imho, since "asdf" not > being in "" is no different than "asdf" not being in "jackalope". > > -Brandon > > _______________________________________________ > Cold-Coldstuff mailing list > Cold-Coldstuff@cold.org > http://web.cold.org/mailman/listinfo/cold-coldstuff > From michael at mudge.com Sat Jun 14 21:35:39 2003 From: michael at mudge.com (Michael Mudge) Date: Sat Jun 14 18:34:32 2003 Subject: [Coldstuff] Integer bug Message-ID: <005401c332d6$0c54f3b0$0200005a@demon> Compile this (minimum integer) return -2147483648; Decompiles to this: return --2147483648; - Kipp From acormany at yahoo.com Tue Jun 24 14:31:18 2003 From: acormany at yahoo.com (Adam Cormany) Date: Tue Jun 24 14:30:35 2003 Subject: [Coldstuff] Deleteing a variable from an object and its children Message-ID: <20030624203118.68490.qmail@web12809.mail.yahoo.com> __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From acormany at yahoo.com Tue Jun 24 14:33:48 2003 From: acormany at yahoo.com (Adam Cormany) Date: Tue Jun 24 14:33:05 2003 Subject: [Coldstuff] Deleteing a variable from an object and it's children Message-ID: <20030624203348.10382.qmail@web12801.mail.yahoo.com> Sorry for the previous blank email, fat fingers. I have a variable on an object($object) called limit. $object has thousands of children, $object_1, $object_2, etc. I tried to do @dv $object,limit and it said it removed the variable and it did from $object, but it didn't touch the children of $object. They all still have limit. How can I fix this? I've tried to recreate $object,limit and then redelete it and so on, but nothing has worked. Any help would be greatly appreciated. Adam __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From acormany at yahoo.com Tue Jun 24 15:31:11 2003 From: acormany at yahoo.com (Adam Cormany) Date: Tue Jun 24 15:30:27 2003 Subject: [Coldstuff] Deleteing a variable from an object and it's children FIXED Message-ID: <20030624213111.75858.qmail@web12809.mail.yahoo.com> I found the problem. There is a problem with $root.descendants(), which $root.del_var() calls. If the object has a lot of children, it runs out of ticks in the first loop of the function. I added a refresh() to the loop and the variable deletion works again. Thought I'd pass it on if anyone has a lot of objects and runs into the same problem... Adam --- Adam Cormany wrote: > Date: Tue, 24 Jun 2003 13:33:48 -0700 (PDT) > From: Adam Cormany > To: Cold > CC: > Subject: [Coldstuff] Deleteing a variable from an > object and it's children > > Sorry for the previous blank email, fat fingers. > > I have a variable on an object($object) called > limit. > $object has thousands of children, $object_1, > $object_2, etc. I tried to do @dv $object,limit and > it > said it removed the variable and it did from > $object, > but it didn't touch the children of $object. They > all > still have limit. How can I fix this? I've tried to > recreate $object,limit and then redelete it and so > on, > but nothing has worked. > > Any help would be greatly appreciated. > Adam > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > _______________________________________________ > Cold-Coldstuff mailing list > Cold-Coldstuff@cold.org > http://web.cold.org/mailman/listinfo/cold-coldstuff __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From brandon at roguetrader.com Tue Jun 24 17:16:48 2003 From: brandon at roguetrader.com (Brandon Gillespie) Date: Tue Jun 24 16:16:10 2003 Subject: [Coldstuff] Deleteing a variable from an object and it's children FIXED In-Reply-To: <20030624213111.75858.qmail@web12809.mail.yahoo.com> References: <20030624213111.75858.qmail@web12809.mail.yahoo.com> Message-ID: <3EF8CDD0.9050608@roguetrader.com> Thanks for the fix. -Brandon Adam Cormany wrote: > I found the problem. There is a problem with > $root.descendants(), which $root.del_var() calls. If > the object has a lot of children, it runs out of ticks > in the first loop of the function. I added a refresh() > to the loop and the variable deletion works again. > Thought I'd pass it on if anyone has a lot of objects > and runs into the same problem... > > Adam > > --- Adam Cormany wrote: > >>Date: Tue, 24 Jun 2003 13:33:48 -0700 (PDT) >>From: Adam Cormany >>To: Cold >>CC: >>Subject: [Coldstuff] Deleteing a variable from an >>object and it's children >> >>Sorry for the previous blank email, fat fingers. >> >>I have a variable on an object($object) called >>limit. >>$object has thousands of children, $object_1, >>$object_2, etc. I tried to do @dv $object,limit and >>it >>said it removed the variable and it did from >>$object, >>but it didn't touch the children of $object. They >>all >>still have limit. How can I fix this? I've tried to >>recreate $object,limit and then redelete it and so >>on, >>but nothing has worked. >> >>Any help would be greatly appreciated. >>Adam >> >>__________________________________ >>Do you Yahoo!? >>SBC Yahoo! DSL - Now only $29.95 per month! >>http://sbc.yahoo.com >>_______________________________________________ >>Cold-Coldstuff mailing list >>Cold-Coldstuff@cold.org >>http://web.cold.org/mailman/listinfo/cold-coldstuff > > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > _______________________________________________ > Cold-Coldstuff mailing list > Cold-Coldstuff@cold.org > http://web.cold.org/mailman/listinfo/cold-coldstuff