117 views
in GUI Development by
it is possible to reuse the value pointed to by a reference of type ^any,
in my case I wanted to use the type of a property observer, but the compiler gives me an error

would indirect access be possible?

1 Answer

0 votes
by

Hello Manuel,

no, it is not possible. There is no runtime information associated to ^any which could allow the system to verify the type of content referred by ^any. Without this information ^any could be misinterpreted causing in worse case a corruption of the referenced memory. When designing the programming language Chora we tried to reduce error sources and provide more security for the resulting application. In particular, the types of all expressions have to be well known and verified already at the compilation time.

The language C, for example, is less restrictive compared to Chora. There you can cast a void* pointer to any content (to a pointer to any other data type). This is very flexible but on the other hand it is a frequent source of difficult to find runtime errors.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...