|
|
|
|
Quick Links
Understanding XL
In depth
Other projects
|
XLR: Extensible Language and Runtime
|
A concept cast happens when a particular concept cannot be represented, and the programmer uses instead a closely related concept as a workaround. For instance, C doesn't have a real notion of array. Instead, it uses pointers. A concept cast like this introduces semantic noise. In that example, the notation A[B] in C is really a shortcut for *(A+B). This makes it very easy to access elements outside the bounds of the array, and overwriting random memory (a frequent source of bugs in C, known as buffer overrun). Another side effect is that it is legal in C to write 1[A] to access the first element of the array, or even -1[A+2]. These notations, however, are somewhat surprising and hard to decode. They are not complicated per-se, but because they have no correspondance in the problem space.
|
Copyright 2006 Christophe de Dinechin (Blog)
E-mail: XL Mailing List (polluted by spam, unfortunately)