World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Izkata 5-Jun-2009 [15158] | Ah, never noticed remove-each could do that, although I've used foreach that way |
BrianH 5-Jun-2009 [15159x3] | If you want to check for sorted, try this (if we support full *EACH syntax): >> all-of [x y:] [1 2 3 4] [any [tail? y x < first y]] == true |
(Soon-to-be) MAP-EACH also supports the record and set-word tricks :) | |
Here's a better check for sorted: >> all-of [x y:] [1 2 3 4] [x <= any [first y x]] == true | |
Paul 5-Jun-2009 [15162x2] | I would change the any-of syntax up a bit myself. |
any-of [x [1 2 3] y [4 5 6]][....] | |
BrianH 5-Jun-2009 [15164x2] | That would require a REDUCE or DO/next to use referenced data, and this function is too inefficient to use with inline data, as compared to the ANY and ALL equivalent code. These functions would only be worth using for large datasets, or otherwise their overhead would be too much. That is the problem ANY+ had :( |
The *EACH syntax is what makes these functions worth using, rather than refactoring away. | |
Paul 5-Jun-2009 [15166] | I'll grow my own as usual then. |
BrianH 5-Jun-2009 [15167] | Didn't you do so already? |
Paul 5-Jun-2009 [15168] | Indeed. |
Steeve 5-Jun-2009 [15169x2] | ** Hint Currently there is problem to complement charsets in R3. To have 256 values in the complement (like in R2), I add the char #"^(FF) in the charset: c: complement charset "0123456789^(FF)" But it's not exactly the same thing (cause the value 255 is not allowed in the complement). Have you any idea to have the "exact" complement (without using a nasty loop to construct the bitset!) ? |
I mean, instead of adding 255 in the initial charset, i should add 256, but i got a curious result doing that. So i may doing it bad. | |
BrianH 5-Jun-2009 [15171] | Complement charsets is almost completely broken in R3, mostly because a full complement of a charset would overwhelm your memory - about 512 megs each. This has been a known problem since last fall, and was the initiial reason for the Parse Proposals. |
Steeve 5-Jun-2009 [15172x2] | well, you didn't read what i've said, because i show a temporary solution |
to fit the R2 behavior | |
BrianH 5-Jun-2009 [15174x2] | Use INSERT on the result: >> insert insert complement charset "^(00)0123456789^(FF)" 0 255 == make bitset! #{FFFFFFFFFFFF003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} |
You forgot the ^(00) at the front. | |
Steeve 5-Jun-2009 [15176x2] | Fine, exactly what i wanted to get, thanks |
we can't add 256 directly in the intial charset, i guess, anyway it's a clever solution. | |
BrianH 5-Jun-2009 [15178] | The complement charset problem is also the inspiration for the FIND/not proposal. |
Steeve 5-Jun-2009 [15179] | Hmmm, no need to add the char #"(00)", it seems... |
Henrik 5-Jun-2009 [15180] | btw. is there a reason why we can use 'unique on a bitset? |
Steeve 5-Jun-2009 [15181] | yep, they don't want bitsets acting like true series |
BrianH 5-Jun-2009 [15182] | Completeness, and to reduce special-casing code. |
Henrik 5-Jun-2009 [15183] | hmm ok :-) |
Steeve 5-Jun-2009 [15184] | Wait a minute... UNIQUE on a bitset! means nothing, they already contain unique values |
BrianH 5-Jun-2009 [15185x5] | Yup, it's a noop. It was deemed more important to eliminate all potential test-to-see-if-something-is-a-bitset-and-not-call-unique code. |
We're trying to make the functions more polymorphic in R3, to reduce special-case code. | |
Where it makes sense, of course (meaning: we can come up with a rationale). | |
For example, SELECT and APPEND also work on objects and maps, and the set functions also work on typesets. | |
Steeve, this works too: insert complement charset "^(00)0123456789^(FF)" [0 255] | |
Steeve 5-Jun-2009 [15190x2] | no need for ^(00) |
same result with: insert complement charset "0123456789^(FF)" 255 | |
BrianH 5-Jun-2009 [15192] | Interesting. I wondered how the sparse charsets were handled - Carl had implied that they were offset (I probably misunderstood). |
Ladislav 6-Jun-2009 [15193x3] | For 2.7.6.3.1: Total: 3028 Succeeded: 2959 Failed: 69 For 2.100.55.3.1: Total: 3155 Succeeded: 3110 Failed: 45 |
Taking into account that R3 implements more features (more datatypes e.g.), I would say, that it already succeeded to "surpass" R2 in its core functionality. | |
(the above are test results) | |
Henrik 6-Jun-2009 [15196] | Is this with Carl's test suite or your own? |
Ladislav 6-Jun-2009 [15197x2] | it is a test suite I wrote for Carl |
(some time ago) | |
Henrik 6-Jun-2009 [15199] | Ladislav, does it look like we can get going with Carl's test suite again? Have you studied it? |
Ladislav 6-Jun-2009 [15200] | Carl gave me some requirements how a test suite should work and I wrote my implementation of his spec. Carl looked at it and he probably felt it was more complicated than what he liked. OTOH, the main difference was, that my test suite tries to give useful informations always when it is possible and continue with testing. |
Henrik 6-Jun-2009 [15201] | I think his desire was that most people could write their own tests. |
Ladislav 6-Jun-2009 [15202x2] | So, it generally doesn't "choke", when encountering "runaway return", "runaway throw", "runaway break", etc. |
most people could write their own tests - yes, that is fulfilled, the test are according to Carl's spec | |
Henrik 6-Jun-2009 [15204] | Did you write the suite before he added the *-of functions? I remember he did a lot of work on those right when he wrote his own test suite. |
Ladislav 6-Jun-2009 [15205x2] | (a block of code, that should evaluate true) |
yes, I wrote it before he wrote the reflector functions, so it does not contain sufficiently many tests of these | |
Henrik 6-Jun-2009 [15207] | maybe that's the complexity issue, he's talking about, or was the discussion recent? |
older newer | first last |