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

World: r3wp

[Core] Discuss core issues

Henrik
7-May-2010
[16483]
? dp
Steeve
7-May-2010
[16484]
it's a function of R3
Terry
7-May-2010
[16485]
is it possible to search the value of map! without looping?
Steeve
7-May-2010
[16486]
well... take that memory problem aside for the moment , and go with 
string keys :)
Terry
7-May-2010
[16487]
wow
Steeve
7-May-2010
[16488]
ouch, don't think so...
Actually maybe your real key is the value and not the key.
Terry
7-May-2010
[16489x3]
that is REALLY fast
1,000,000 GETs  in 1.387 seconds
can't use the value as the key.. it could be 1GB
no matter.. can't search by value in Redis either.. i have a work 
around
Steeve
7-May-2010
[16492x2]
or create a second map! with reversed key-values
ok, you can't
Terry
7-May-2010
[16494x3]
I'm going to try more test.. but if this is accurate,  this would 
be nearly 10x faster than Redis
great.. there goes my weekend :(
thanks for your help
Henrik
7-May-2010
[16497]
small detail that may be useful:

>> series? make map! []
== false
BrianH
7-May-2010
[16498]
DP: :DELTA-PROFILE, meaning change in profile. It's R3's built-in 
profiler. R3 also has a built-in timer, DT: :DELTA-TIME.
Maxim
7-May-2010
[16499]
happy to have helped  :-)
BrianH
7-May-2010
[16500]
Terry, try FIND VALUES-OF map value, if you can afford to trade memory 
overhead for the loop.
Terry
7-May-2010
[16501x2]
can you return the key somehow?
after some testing strings as keys and values are the way to go.. 
slightly faster ( to-binary? overhead?) and when you write the db 
to file, the strings are half the size
Graham
9-May-2010
[16503]
How does one sort on the 3 item in a seres?
Henrik
9-May-2010
[16504]
example?
BrianH
9-May-2010
[16505]
Use SORT/compare with an integer argument for the index of the records 
you want compared, and don't forget /skip for the record length. 
Like this:
>> sort/skip/compare [1 5 2 4 3 3 4 2 5 1] 2 2
== [5 1 4 2 3 3 2 4 1 5]
Sunanda
9-May-2010
[16506x2]
You mean using /skip and /compare to sort a series in sets?
s: [1 2 8 a   1 2 6 b   1 2 7 c]    ;; three sets of four items
sort/skip/compare s 4 [3]        ;; sort on the third item
== [1 2 6 b 1 2 7 c 1 2 8 a]
oops --- Brian just beat me to it!
Graham
9-May-2010
[16508]
thanks .. can someone update the docs http://www.rebol.com/docs/words/wsort.html
BrianH
9-May-2010
[16509]
Didn't know you could put the /compare index in a block. Can you 
specify more than one index?
Sunanda
9-May-2010
[16510]
Yes you can:
sort/skip/compare s 4 [1 2 4 3]
== [1 2 8 a 1 2 6 b 1 2 7 c]
BrianH
9-May-2010
[16511]
Graham, no, noone can update that doc page, it's a permissions issue. 
All docs updates by anyone other than Carl are on hold.
Graham
9-May-2010
[16512x2]
someone = Carl
:)
BrianH
9-May-2010
[16514x2]
Ask in chat or CureCode, Carl won't see the request here.
It's best to ask in CureCode anyways, because the request will stay 
there where we can find it until the issue is fixed.
Graham
9-May-2010
[16516]
some of the browsers allow you to annotate the page so I can see 
my own notes
BrianH
9-May-2010
[16517]
But the people who would fix the docs won't see your notes.
Graham
9-May-2010
[16518x2]
But at least I will ...
And when we get the permissions to do so, we can then
BrianH
9-May-2010
[16520]
OK, good, that way you will remember to submit a CureCode ticket 
later.
Henrik
9-May-2010
[16521x2]
>> a: 0.24.26
== 0.24.26
>> poke a 2 155
== 0.155.26
>> a
== 0.24.26 ; huh?
fixed in R3 though.
Ladislav
9-May-2010
[16523x7]
>> a: b: 0.24.26
== 0.24.26

>> poke a 2 155

** Script error: poke does not allow tuple! for its value argument
if you consider that fixed, then I do agree with you
nevertheless, the behaviour in R2 looks reasonable too
(taking into account, that tuples are immutable)
re "ask in chat or CC" - I asked in chat, privately, but do not see 
any reaction yet, and I added a comment to CC #1571
also: http://eupat.ffii.org/
sorry, misplaced post
Henrik
9-May-2010
[16530]
since tuple are not series in R3, then I'd say it's fixed.
Maxim
10-May-2010
[16531]
tuple aren't immutable in R2 OR R3

>> a: 1.2.34
== 1.2.34
>> a/2: 33
== 33
>> a
== 1.33.34

this works in both R2 and R3
Steeve
10-May-2010
[16532]
nope, they are

>> a: b: 1.2.3
== 1.2.3
>> a/1: 33
== 33
>> a
== 33.2.3
>> b
== 1.2.3