[REBOL] Re: Question and comment about randomizing a block of values
From: gjones05:mail:orion at: 19-Jun-2001 13:11
From: "Joel Neely"
> Hey, Scott,
> Which part? See below
Oh, the "usual" part, you know, the one that becomes obvious once someone points
it out in a different way!!
> > From: "Jeff Kreis"
> > > random/seed now/time
> > > c: 0
> > > x: random reduce head insert/dup copy  [c: c + 1] 52
> > >
> > > ; -- produces a block of 1 - 52 randomly ordered
> From: "Scott Jones"
> > I've been thinking about this on and off for two hours, and I
> > still do not understand how this statement works. Can someone
> > state what is going on in other words?
JN> The deep magic (the part I didn't know about ;-) is that RANDOM
JN> will take a block and return a "randomized" copy of the block:
This was ultimately the stumper portion. I thought I understood 'random, so I
was looking for the magic elsewhere. Since I was not really familiar with
insert/dup, I figured that I must be misunderstanding something inherent in the
construct. Just like the append "problem" (problem for me only!!) from last
week, cognitively, I keep falling for the red herring. What annoys me once
again, is that I should know better, and should have been using your
reductionist approach. Obviously I didn't learn the real lesson last time, and
I'll just have to wait and see if I have learned it this time. Thanks for the
JN> Cool, huh? Thanks again, Jeff!
This is the sort of abstraction and encapsulation of functionality that just
blows me away in regards to REBOL. Good job RT!