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

World: r3wp

[!REBOL3-OLD1]

Henrik
29-Apr-2009
[13747]
http://www.rebol.net/r3blogs/0194.html

SELECT/SKIP behavior discussion needed now.
shadwolf
29-Apr-2009
[13748x2]
comment posted i don't know if that will make any sens ...
select/skip b 3 returning 20  only is an aberation ... that's not 
what we expect ...
BrianH
29-Apr-2009
[13750x2]
It's what I expected, but I've never used SELECT/skip in R2. The 
R2 behavior sounds better to me.
It sounds silly, but after 9 years there are still parts of REBOL 
I've never used :(
Maxim
29-Apr-2009
[13752]
but the skip becomes pretty useless, as you can get the inner records 
of the skip.
shadwolf
29-Apr-2009
[13753]
BrianH hum same for me ...
Maxim
29-Apr-2009
[13754x2]
the /skip in many functions are implied records... and the reason 
they are there... not getting the record as a return values... is 
an oxymoron IMHO
I still discover new functions after 9 years too  :-)
BrianH
29-Apr-2009
[13756]
Maxim, are you in favor of the R2 behavior or the current R3 behavior? 
Or something else?
Maxim
29-Apr-2009
[13757x2]
R2
the R3 return sort of alleviates the point of the /SKIP refinement 
no?
BrianH
29-Apr-2009
[13759]
So am I. I wasn't saying I preferred it, just that I expected it. 
I think this is why I've never used select/skip :(
Henrik
29-Apr-2009
[13760]
The R2 method is much more flexible. The R3 method is identical to 
"first select/skip", and I doubt there would be that much gained 
by having a specific alternative function for the R3 method.
BrianH
29-Apr-2009
[13761]
I prefer the R2 method
 - I bet noone expected me to ever say that :)
Henrik
29-Apr-2009
[13762]
BrianH, not working much with flat blocks, eh?
Maxim
29-Apr-2009
[13763x2]
its like sort/skip there is a simple consistency in the implied records 
which I always like... other languages will have a framework just 
for that...
brian: LOL
BrianH
29-Apr-2009
[13765]
I tend to use FIND and SET [w1 w2 ...]
Maxim
29-Apr-2009
[13766x2]
but find will trip if records ands content can have the same datatypes... 
wich is why the /skip refinement makes sense.
(for select)
BrianH
29-Apr-2009
[13768]
Sorry, FIND/skip
Henrik
29-Apr-2009
[13769]
Maxim, yes. I'd say that if every single REBOL function used /SKIP 
consistently, you could do flat block databases and rely on /SKIP 
without getting your records screwed up.
Maxim
29-Apr-2009
[13770]
its almost the case now... sort/skip  find/skip  select/skip
Henrik
29-Apr-2009
[13771]
hey, here's a fun one:

a: [1 2 3 4 5 6 7 8]

select/skip a 5 -4

hangs.
Maxim
29-Apr-2009
[13772x2]
which function is fundamentally different in this regards ?.... I 
don't seem to recall one off the top of my head
(in regards to /skip)  post order makes my last post a bit out of 
context
BrianH
29-Apr-2009
[13774]
Henrik, is that in R2 or R3?
Henrik
29-Apr-2009
[13775x7]
R3.
I noticed something weird too. If you have multiple R3 windows open 
and switch between them, does the window title change?
select/skip issue submitted to curecode.
The window title thing seems to be related to marking up text in 
the console and is not caused by R3. Never noticed that before.
it seems FIND/SKIP does the same thing. :-)
Alpha 50 released.
7 reports with /SKIP issues.
BrianH
29-Apr-2009
[13782]
Clearly we are going to need a /SKIP doc in R3/Language/Options.
Henrik
29-Apr-2009
[13783]
Agreed.
BrianH
29-Apr-2009
[13784]
I wrote MOVE, so talk to me. How should MOVE with negative skip work? 
Allowed or denied?
Henrik
29-Apr-2009
[13785x2]
I don't really know. I guess we want consistency?
From what I can see the correct way is to provide an out of range 
error on less than zero.
Maxim
29-Apr-2009
[13787]
move is like next but modifies the series itself?
BrianH
29-Apr-2009
[13788]
We don't have consistency, so I figured I'd start with a fuunction 
I understand.
Maxim
29-Apr-2009
[13789]
should say move is like skip
BrianH
29-Apr-2009
[13790x2]
No, move actually moves stuff.
move: make function! [[
    "Move a value or span of values in a series."
    source [series!] "Source series"
    offset [integer!] "Offset to move by, or index to move to"
    /part "Move part of a series"
    length [integer!] "The length of the part to move"
    /skip "Treat the series as records of fixed size"
    size [integer!] "Size of each record"
    /to {Move to an index relative to the head of the series}
][
    unless length [length: 1]
    if skip [
        offset: offset * size: max 1 size
        length: length * size
    ]
    part: take/part source length
    insert either to [at head source offset] [
        system/words/skip source offset
    ] part
]]
Maxim
29-Apr-2009
[13792]
ok, like a change remove combo
BrianH
29-Apr-2009
[13793]
Right, but safer.
Henrik
29-Apr-2009
[13794]
BrianH, do we want consistency across all /SKIP or not? That is a 
big issue. Personally I would like it.
BrianH
29-Apr-2009
[13795]
We want consistency. We don't have it yet. So this is a start.
Henrik
29-Apr-2009
[13796]
OK. The solution would be to generate an out of range error for skip 
<= 0. DIFFERENCE does that correctly.