World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Steeve 15-Nov-2007 [5323] | a proposal of a refinement for alter: alter/count increment a value instead of add/remove it, return the total count for this value. >> alter/count [] 'a == 1 >> alter/count [a 1] 'a == 2 |
Oldes 16-Nov-2007 [5324x3] | Instead of ALTER functionality I use this quite a lot... but I'm not sure I would use funtion with refinement for this as I use it in loops where speed is important. |
But if you need it, you can use something like that: alter-count: func[ block [any-block!] value [any-type!] /local temp count ][ either temp: find/tail/skip block :value 2 [ change temp count: temp/1 + 1 count ][ append block reduce [:value 1] 1 ] ] (the name of the function should be probably different) | |
It cannot be part of ALTER function as ALTER can be used with any series. I'm not sure how you could strore the counts in bitsets or strings;-) | |
Steeve 16-Nov-2007 [5327] | one-liner version: alter-count: func[ block [any-block!] value [any-type!] ][ pick change block: any [find/tail/skip block :value 2 insert tail block :value] 1 + any [block/1 0] -1 ] |
Anton 19-Nov-2007 [5328] | More than ALTER, I would like append-if-necessary remove-if-necessary (but probably with better, shorter names) |
Steeve 19-Nov-2007 [5329x4] | huh ? |
yeah! i posted my first modification on devbase | |
even if i have don"t access to alpha T_T | |
hum * i haven't an access | |
Steeve 20-Nov-2007 [5333x2] | i have some difficultes to construc devbase.r , missing icons in the title, any idea ? |
sorry , i got no problem in fact (i just have to open my eyes) | |
Henrik 21-Nov-2007 [5335] | everything should download automatically |
BrianH 21-Nov-2007 [5336x2] | These alter-count functions aren't taking R3 into account. Most of these key/value usage patterns will be handled by the map! type in R3. ; alter-count, just code since it's too simple for a function key-counts/:key: 1 + all [key-counts/:key 0] |
Whoops: all -> any | |
Steeve 21-Nov-2007 [5338] | not agree, how do add new key with your code ? |
BrianH 21-Nov-2007 [5339x3] | Like that. |
Doesn't work in R2, but this is the !REBOL3 group, isn't it? :) | |
The trick is that you can't remove keys, but if you assign none to the map at a given key the effect is the same. | |
Steeve 21-Nov-2007 [5342] | i see |
BrianH 21-Nov-2007 [5343] | The general pattern in R3 is that none is the equivalent of missing data. Pick off the end of a series returns none too. |
Steeve 21-Nov-2007 [5344x2] | more tolerant functions |
throw less errors | |
BrianH 21-Nov-2007 [5346] | Recovering from a none is easier and more efficient than recovering from an error. Series bounds are just an implementation detail anyways, when you have series that can autoexpand. |
PeterWood 21-Nov-2007 [5347] | Does that mean I won't be able to build the equivalent of an R2 hash! with map! in R3? I use a hash! to build a unique list of words as it was far quicker than any other method I could come up with. |
BrianH 21-Nov-2007 [5348] | Yeah, hash! has been replaced with map!, which is faster but more specialized. You could either use block!, assign true to the map! at the word key, or keep a word count. |
sqlab 22-Nov-2007 [5349x3] | this works in R2 key-counts/:key: 1 + any [select key-counts :key do [repend key-counts [:key 0] 0 ] ] |
key-counts/:key: 1 + any [select key-counts :key do [repend key-counts :key 0] ] | |
forget the second | |
PeterWood 22-Nov-2007 [5352] | Thanks for the suggestions: I think that I'll have to use a map! with a dummy value as using a block! was too slow. |
Oldes 26-Nov-2007 [5353] | I'm missing hash! in R3 because with map! I cannot use integers as keys... I hope it will be changed. |
BrianH 26-Nov-2007 [5354] | It's hard in hash! as well, but I agree. There is some missing infrastructure around the map! type as well, like iteration and searching. |
Mchean 10-Dec-2007 [5355] | has the conversation moved elsewhere? |
Pekr 11-Dec-2007 [5356] | no, it is just some kind of slow-down period. Activities around R3 should be renewed as we speak, it seems Gabriele and Cyphre will be back on R3 full-time soon. There is also draft of release strategy. It seems RT decided (upon suggestions) to divide R3 release, so we should see Core like R3 alpha in one month, View will come later (2 - 3 months) |
Mchean 11-Dec-2007 [5357] | I should have figured... December is a slow month |
PeterWood 12-Dec-2007 [5358] | I gleaned some good news from Docbase: work has started on implementing unicode support :-) |
Henrik 13-Dec-2007 [5359] | Yes, this is Carl's main focus now. |
Louis 13-Dec-2007 [5360] | That is great news. How far along is it? |
Pekr 13-Dec-2007 [5361] | As for unicode, first draft should be in few days, or that is how I understand it :-) |
Louis 13-Dec-2007 [5362] | Pekr, thanks Pekr, that is encouraging! |
Kaj 13-Dec-2007 [5363] | Does this mean that R3 will not become available in DevBase for several more months? |
Henrik 13-Dec-2007 [5364] | R3 mezzanines are already in devbase |
Kaj 13-Dec-2007 [5365] | Yes, but does this mean that R3 as a running system will not be available in DevBase for several more months? |
Henrik 13-Dec-2007 [5366] | what do you mean by "running system"? if you mean the R3 version of DevBase, I don't think it will be possible until VID3 is advanced enough. |
Kaj 13-Dec-2007 [5367] | No, I mean the R3 product that was promised for two weeks ago |
Henrik 13-Dec-2007 [5368] | it was? :-) |
Kaj 13-Dec-2007 [5369] | Yes |
Henrik 13-Dec-2007 [5370] | where did you read that? |
Kaj 13-Dec-2007 [5371] | Carl wrote it on his blog |
Henrik 13-Dec-2007 [5372] | so he hasn't yet gotten rid of the bad habit of posting estimate times... don't believe them. :-) |
older newer | first last |