Version française
Home     About     Download     Resources     Contact us    
Browse thread
Unsafe features
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: yoann padioleau <padator@w...>
Subject: Re: [Caml-list] Unsafe features

On 3 sept. 05, at 16:28, Florian Weimer wrote:

> * yoann padioleau:
>
>
>>> Apparently, it creates a bit-wise copy of a value and assigns it  
>>> a new
>>> type.
>>>
>>
>> Are you sure ? I thought it was just a function to get rid temporary
>> of the typing system, a kind of cast operator.
>>
>
> It is, but how would you define such a operator?

obj.ml contains:
   external magic: 'a -> 'b = "%identity"

So I guess there is no bit-wise copy involved.

>
>
>> But is is bad to use it, very bad, shame on you if you use it
>> (i just put this statement to be sure that xavier leroy will not
>> shout over me).
>>
>
> Yes, and my question was to avoid such unsafe language features.
>

I know :) It is just that I have the feeling that the ocaml team does  
not like when someone talk
about Obj.magic,  so I put a disclaimer.

>