qtxie on master
FIX: better fix for issue #4706… (compare)
mydata: make hash! [ key1 value11 value12 value13 key2 value21 value22 value23 key3 value31 value32 value33 key4 value41 value42 value43 key5 value51 value52 value53 ] myselect: func [data key len pos][ pick find/skip data key len pos ] myselect mydata 'key1 4 1 ;== key1 myselect mydata 'key1 4 3 ;== value12 myselect mydata 'key3 4 2 ;== value31 myselect mydata 'key5 4 4 ;== value53
select is not going to add this feature. It's design was reconsidered to match R3, not R2, and @toomasv showed the way to do this. What is one short line in Red, would be a large amount of Red/System code in multiple datatypes, because it's an action.
I appreciate that you have a different perspective, but when deeply experienced Reducers push back on your idea, you tend to push forward with the same request again. Do NOT write a request for these.
Find/Select work this way by design.
I was working on this Atomica stuff back in 2010, so trying to refresh my memory climbing over the Altme archives, and came across this historical conversation. It's @dockimbel , @gchiu and I discussing the pros and cons of cloning Rebol. Interesting read.
but when deeply experienced Reducers push back on your idea, you tend to push forward with the same request again
Greg, I didn't read this part. Why I ask a second time ? I see in my this vision the RED documentation chapter on Select with an example like mine and new developers all thinking: "great I can search in a blocks like I actually do in databases table, what a great language!". This because in the example you will show them intersects with what they are used to manage day after day. Do you know that showing to the potential adopters, in the very first moments, an operational framework similar to their usual one increases the adoption chance? I am a developer too and I remember when I have chosen something because of that something interacting with my needing. These are the reasons that would drive the request to reconsider that
/pos refinement: its a MARKETING one other than a functional one.
However, thanks to your reply came the idea of creating a page about using RED blocks as database tables in programming.red.
Select is one of the core instruction of Red.
It is not a fundamental "instruction", it is just a convenient syntactic sugar for
second find on series to cover the common bias towards key/value pairs. You can build your own specific
select-nth variation trivially (
pick find ... nth), there is no need to bloat the runtime environment with such construct.