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

World: r3wp

[Core] Discuss core issues

Terry
7-May-2010
[16491]
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
Maxim
10-May-2010
[16533x2]
ok... yeah in that sense.
they aren't series.
Ladislav
10-May-2010
[16535]
tuple aren't immutable in R2 OR R3

 - it is discussed in http://www.rebol.net/wiki/Identity#Expressions_modifying_their_values

Tuples are exactly as mutable as integers in R2 as well as in R3
amacleod
11-May-2010
[16536x2]
BrainH asked: Didn't know you could put the /compare index in a block. 
Can you specify more than one index?

Sunanda says: Yes you can:
sort/skip/compare s 4 [1 2 4 3]
== [1 2 8 a 1 2 6 b 1 2 7 c]


That's great but can you do that with a block of blocks of  data....

example: 
s: [
	[1 2 8 a]
	[1 2 6 b] 
	[1 2 7 c]]
]
remove extra ]
Maxim
11-May-2010
[16538]
use a compare function for that
amacleod
11-May-2010
[16539]
So nothing as easy as Sunanda's example built into rebol?
Sunanda
11-May-2010
[16540]
To turn Maxim's comment into an example:

   sort/compare s func [a b] [
== [
    [1 2 6 b]
    [1 2 7 c]
    [1 2 8 a]
]
s