* Izkata <[EMAIL PROTECTED]> [050930 14:19]:
>
> > ;; and 'repeat operating on a non-empty series:
> >>> t: repeat ch "ab"[ch]
> > == #"b"
> >>> t
> > == #"b"
> > ;; inconsistent!
>
> They're all returning the final value, so that is consistent:
> >> g: repeat x {eh?} [? x x]
> X is a char of value: #"e"
> X is a char of value: #"h"
> X is a char of value: #"?"
> == #"?"
> >> g
> == #"?"
>
> And loop done the same way:
> >> i: 1
> == 1
> >> t: loop 6[? i i: i + 1]
> I is an integer of value: 1
> I is an integer of value: 2
> I is an integer of value: 3
> I is an integer of value: 4
> I is an integer of value: 5
> I is an integer of value: 6
> == 7
> >> t
> == 7
>
> Here's how to do that Repeat line if it's to hold the string:
> >> g: repeat x {eh?} [? x append {} x]
> X is a char of value: #"e"
> X is a char of value: #"h"
> X is a char of value: #"?"
> == "eh?"
> >> g
> == "eh?"
>
> And the reason for the error - the block is
> never evaluated, so nothing can be returned.
> >> repeat x 0 [] ;Look: nothing shown in the console
> >> t: ;So it is equivalent to this line
> ** Script Error: t needs a value
> ** Near: t:
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
Understood:
The reason for the error is clear to me - it remains
inconsistant. IMHO, an action value or function
should either always return a value
OR
always not return a value.
--
Tim Johnson <[EMAIL PROTECTED]>
http://www.alaska-internet-solutions.com
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.