> a: "12345"
>  
> probe index? find a => 3
>  
> probe copy/part a 3 => "123"
>  
> probe copy/part a find a "3" => "12"
>  
> I expected 3 being the return value of -find a "3"- as it is the index of
> the series returned by the fuction find but Rebol works differently
> considering it the "end position" 
>   

yes, maybe a bit confusing, but handy behavior. We are evaluating from 
left to right. So - what is first is copy/part function. And it either 
accept number of chars to copy, or it takes position you want to copy 
to. Your logic here is imo not rigth. You clearly stated, you want to 
"copy/part a", starting at the head of 'a. To achieve what you want to 
achieve, you would have to reverse logic - " probe copy/part find a "3" 
3" or use some other aproach. This behavior is handy especially when 
using change/part. You don't need to care, and the exact part is being 
replaced and string shifted for you.
>  
> The fourth learning difficulty arised on string inside objects and functions
> they are static and global. I must use COPY to have another issue of the
> string. Instead I would expect to have it initialized each I declare a:
> "mystring". For the same reason I must use COPY/DEEP to copy sub-blocks
> inside block of data.
>   
Ah, ok. This is really a bit difficult category of problems for 
newcomers. Subobject sharing caused me many headaches, especially in 
View, when I directly accessed e.g. button border. It changed all button 
borders instead :-) The most difficult part of REBOL series operation is 
unbound strings/blocks! So many times I found out, that their values is 
shared/persistent, that to be safe I use copy when not sure of the 
result :-)

I think that Core documentation tried to explain series concept nicely. 
What I would probably do is to create some gotchas category, describing 
exactly those small details, which might take you tens of minutest to 
debug ...

Petr

>  
> Giuseppe Chillemi
>  
>
>
>   

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to