[EMAIL PROTECTED] wrote:
> thanks, [EMAIL PROTECTED], that is what I was trying to achieve.
> "change" sure does the trick. However, it is interesting that REBOL let you
> do this:
> >> blk: [["A" "B" "C"] ["D" "E" "F"]]
> == [["A" "B" "C"] ["D" "E" "F"]]
> >> blk/1/1: "X"
> == ["X" "B" "C"]
> but not this:
> >> i: 1
> == 1
> >> blk/:i/:i: "Y"
> ** Syntax Error: Invalid word -- :i:.
> ** Where: (line 1) blk/:i/:i: "Y"
> >> [blk/:i/:i]: "Y"
> ** Syntax Error: Invalid word-get -- :.
> ** Where: (line 1) [blk/:i/:i]: "Y"
> all I am trying to do is substitute the "value" 1 with :i both are
> equivalent, are they not? IMHO expressions like these should be evaluatable
> as they are so convenient to construct and I can think of lots of other
> advantages for this type of syntax.
Well, this discussion was held on beta ml before 2.x came out. I don't remember
exactly, what were all the pros and cons. But yes, it seems logical to have
blk/:i/:j: value available, as it works for blk/1/2: value.
Maybe Elan or Ladislav could say more here, as I feel they are good at
explaining similiar stuff ... :-)
-pekr-
>
> Nitish
> [EMAIL PROTECTED]
> http://www.loka.net/
> PS: Sorry, folks - for sending my first message out twice..I am
> learning...:)
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, 15 February 2000 20:32
> To: [EMAIL PROTECTED]
> Subject: [REBOL] [REBOL] Prime number generator Re:
>
> [EMAIL PROTECTED] wrote:
>
> > I have one question, though (several actually, but this one will do for
> > now, I think :)
> > [flags/:mult: 0 gives this error
> > ** Syntax Error: Invalid word -- :mult:.
> > ** Where: (line 45) flags/:mult: 0 ;-- this does not work. why? NV
> 6/2/2000
> > This stumped me. Earlier I had declared [mult: make integer! 1] Surely,
> it
> > is in scope.
> >
>
> REBOL doesn't support this kind of syntax:
>
> ->> i: 1
> == 1
> >> j: 2
> == 2
> ->> blk: [["A" "B" "C"] ["D" "E" "F"]]
> == [["A" "B" "C"] ["D" "E" "F"]]
> ->> blk/:i
> == ["A" "B" "C"]
> ->> blk/:i/:j
> == "B"
> ->> blk/:i/:j: "Q"
> ** Syntax Error: Invalid word -- :j:.
> ** Where: (line 1) blk/:i/:j: "Q"
>
> ->> change blk/:i/:j "Q"
> == ""
> ->> blk
> == [["A" "Q" "C"] ["D" "E" "F"]]
> ->>
>
> Is that what you wanted to achieve?
>
> -pekr-
>
> > Nitish.
> > [EMAIL PROTECTED]
> > http://www.loka.net/