Path: news.cs.au.dk!not-for-mail From: nospam2159@cs.au.dk (Peter von der Ahé) Newsgroups: comp.lang.beta Subject: Re: Access violation when using arrays? Date: 09 Nov 1999 12:23:32 +0100 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 26 Message-ID: References: <19991109090403.14988.qmail@noatun.mjolner.dk> NNTP-Posting-Host: ufleku.cs.au.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xinwen.cs.au.dk 942146612 8796069 255.255.255.255 (9 Nov 1999 11:23:32 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 9 Nov 1999 11:23:32 GMT X-Attribution: Ahe User-Agent: Gnus/5.070097 (Pterodactyl Gnus v0.97) Emacs/20.4 Xref: news.cs.au.dk comp.lang.beta:12156 >>>>> "SK" == \[tricos com\] Sascha Kimmel writes: SK> Well, the question is why it is allowed to use "array1->array2"? SK> The arrays differ in length and have different types of objects - SK> why can I do that? The compiler cannot know that your repetions have different lengths, but that doesn't matter. In the BETA book it says that: R2[e1:e2] -> R1 means e2-e1+1 -> R1.new; R2[e1] -> R1[1]; R2[e1+1] -> R1[2]; ...; R[e2] -> R1[R1.range] where R1 and R2 are repetitions. It is fairly easy to see how this translates to the situation where you do R2 -> R1. Remember that BETA almost newer uses types, but checks that the objects have "compatible" exit and enter parts (the exit and enter parts are empty in your case, which probably is an error the compiler should catch). Cheers, Peter