r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3-OLD1]

Steeve
6-Nov-2007
[5295]
great
Graham
9-Nov-2007
[5296x3]
Some serious memory usage here in Ladislav's spelling corrector which 
is also in RebGUI

Script: "Spelling Corrector" (none)
loading and initializing(500kb dictionary)...

{somue spelin wordz tu tepst. Fur szore azd seren yaars aga, our 
fatheers brougt fourth on this lans a new natiun.}
some 10605095
spell 25275846
words 25615457
to 25928767
test 25275846
fur 25415461
swore 25755072
and 26071006
seen 26410617
years 26750228
ago 27066162
our 27205777
father 33781190
brought 34123425
fourth 34263040
on 34402655
this 34542270
lane 34860828
a 35000443
new 35140058
nation 27291974

0:00:04.717
I wonder what it looks like in R3
I ran it on about 200 words that came from an ocr attempt and it 
crashed with an out of memory error.
Pekr
13-Nov-2007
[5299x3]
For those not being on r3-alpha world. R3 development was "resumed". 
Not that it was halted, but I hade private chat with Carl for few 
days, and we got into agreement into how to proceed. I wonder, if 
I am working as an marketing RT guy already? :-) Well, it was nice 
and realistic chat. We identified, that priorities have to be sorted. 
And I suggested Carl to blog about it. Developers were polled for 
the priorities, and we found out, that there are mostly two groups:


- one that prefers View/VID plus schemes being done, so that ppl 
can continue with their app development

- and the other group, who would like to have surrounding infrastructure 
implemented. You probably will not be surprised I belong to this 
group :-) 


As for infrastructure, I simply asked Carl, if we get any improvement 
to dll component, and he admitted, that that might be task for us, 
using plug-in API - simply a cleaner and abstracted aproach. But 
- in order for plug-ins to work, we need modules. So - the next focus 
is to get module system working. It is a logical step imo.


RT working on modules does not mean VID should be halted. VID (whole 
View) will be most probably fully open source, so it is more of a 
community aproach. Ah, and we were scared a bit by consideration 
of dropping of R3. Due to architecture changes for R3, Rebcode might 
not be so fast as in R2, but developers said their NOOOOOO, so I 
hope Rebcode will come too in some form :-)


Ah, and as developers complained a bit about rebol console, Carl 
said well then, as you wish, and uploaded C source code for stdio 
device into DevBase.


Guys, my belief is, that things will start to move faster and faster 
with DevBase and cooperation.


Disclaimer: none of above is direct quote from my talks with Carl. 
It is just my understanding of current situation ....
I wonder if I could post that as an encouragement message to ML?
And someone please update rebolweek :-)
Graham
13-Nov-2007
[5302]
Anton ????
btiffin
13-Nov-2007
[5303]
RebolWeek updated.
Pekr
14-Nov-2007
[5304]
Nice collection of updates. That way, reading rebolweek, it keeps 
good image of REBOL, it feels like there is some sign of life with 
REBOL, and that is always good.
Sunanda
14-Nov-2007
[5305]
Thanks Brian -- nice to know what's going on :-)
Steeve
14-Nov-2007
[5306x4]
.
I have always wondered what was the point of the function alter?
someone is using  it ?
*
btiffin
14-Nov-2007
[5310]
Steeve;  Sunanda uses it in his world class index builder SKIMP. 
 rebol.org  skimp.r  It's a heady read I might add.  After giving 
it a glance ask yourself if Sunanda cut his teeth on personal computers 
or Big Iron.  :)
Sunanda
15-Nov-2007
[5311]
'alter is short for  'alternate (ie alternate between two states).

It's a shorthand way to add an item to a series if it is not there, 
or remove it if it is.

I may create strange data structures, but I use 'alter all the time.
Anton
15-Nov-2007
[5312x3]
Steeve, I actually used it once the other day.
I think I used it like this:
	if not find block item [alter block item]
But it seems an inefficient way of doing things.
Henrik
15-Nov-2007
[5315]
I always found ALTER less than useful. Never used it.
Ingo
15-Nov-2007
[5316]
Hi Anton, did you 'source 'alter?

alter: func [

    {If a value is not found in a series, append it; otherwise, remove 
    it.} 
    series [series! port!] 
    value 
    /local temp
][

    either temp: find series value [remove temp] [append series value]
]

So, you'd better off with:

if not find block item [append block item]
Henrik
15-Nov-2007
[5317]
interesting
Ingo
15-Nov-2007
[5318]
But I think, that the return value of alter is less than usefull, 
There's no way of knowing, whether the value has been added or removed 
... other than doing a 'find on it afterwards ... ;-)
Henrik
15-Nov-2007
[5319]
true.
Anton
15-Nov-2007
[5320x2]
Sorry, I did not use the example I gave above. Actually, I used alter 
like this:
	alter opened-rows count
That was probably my first use of alter ever.
Ingo
15-Nov-2007
[5322]
Now, that seems more in line, with how it's meant to be used.
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
[5344]
more tolerant functions