qtxie on master
FIX: macOS: crashes when settin… (compare)
Compiling Red console...
*** Compilation Error: argument type mismatch on calling: >>
*** expected: [number!], found: [pointer! [byte!]]
*** in file: %/C/Users/regillig/Documents/MEGA/Code/AoC2017/Day24/modules/view/backends/windows/gui.reds
*** in function: exec/gui/adjust-selection
*** at line: 1861
*** near: [- p head unit-b
case [
size > end/1 [break]
size > bgn/1 [end/1: end/1 - 1]
true [bgn/1: bgn/1 - 1 end/1: end/1 - 1]
]
]
Bug?
I create a hash! with 75,000 strings of triples using this code.
n: 1
loop 25000 [
s: rejoin ["user" n]
p: rejoin ["pred" n]
v: rejoin ["val" n]
append db reduce [s p v]
n: n + 1
]
giving me db: make hash! ["user1" "pred1" "val1" "user2" "pred2" "val2"...
I then save this using this code...
saveit: does [
dbsave: to-block db
save %db.txt dbsave
dbsave: copy []
]
(not sure that's the best way to do that, but it works..open to suggestions!)
When I check the %db.txt, it's saved it as "user1" "pred1"... etc, BUT
It stops saving at "pred19532" ?? It goes only that far every time.
It works fine using the exact same code in Rebol 2
Also when I use save/all %db.txt db
when I view the first bit of the db.txt file..
Rebol
.. #[hash!["user1" "pred1" "val1" "user2" "pred2"
Red
.. make hash! ["user1" "pred1" "val1" "user2"
mold/all
to see what is the string result used by save/all
.
I find myselft using really often the the /skip
refinement with select. Having a block like the following (or any one treated as record)
myblock: [
key1 value1 value2 value3
key2 value1 value2 value3
key3 value1 value2 value3
key4 value1 value2 value3
key5 value1 value2 value3
]
Select/skip
can't select anything other than the the first column: value1, which is quite limiting.
I see useful removing this limit adding an additional /pos
(or /offset
) integer refinement to select
so instead of the first value, any other could be selected! Without /skip
the pos
/offset
refinement should return the nth value after the key.
>> my_func: function [params [block!]][foreach x params [print x]]
== func [params [block!] /local x][foreach x params [print x]]
>> ? my_func
USAGE:
MY_FUNC params
DESCRIPTION:
MY_FUNC is a function! value.
ARGUMENTS:
params [block!]
>> my_func ["one" "two" "three"]
one
two
three
>>
>> copy/part find/skip myblock [key2 value1] 4 4
== [
key2 value1 value2 value3
]
>> third find/skip myblock [key2 value1] 4
== value2