strong/weak typing and pointers

Christophe Cavalaria chris.cavalaria at free.fr
Tue Nov 2 19:17:37 EST 2004


Steven Bethard wrote:

> Christophe Cavalaria <chris.cavalaria <at> free.fr> writes:
>>
>> If by ML you thing of OCaml you should try again. OCaml isn't type safe
>> because of a few modules of the standard library. The marshaling module
>> comes to mind. Using it you can "typecast" a pointer to an integer as a
>> pointer to a string and segfault in the process because the unmarshal
>> function trusts the caller to cast the result in the good type.
> 
> Thanks, I knew I'd read something like that somewhere.  Totally surprised
> me too 'cause I figured that, of all people, ML folks would be the most
> afraid of a module like this. =)
> 
> Steve

Marshaling ( Python calls it pickling ;) ) is somthing needed in the
standard library of any good language. Too bad for them that the OCaml
language makes it impossible to implement.



More information about the Python-list mailing list