Erik de Castro Lopo <mle+s...@mega-nerd.com> writes: > Daniel Pittman wrote: > >> Generally, I think, the strong/weak dichotomy is black and white: either >> the language allows you to treat arbitrary bytes of memory as two >> different types, or it doesn't — I can't find any exceptions. > > Ocaml has a standard module Marshall with is unsafe and it is also > possible to do very evil things with the Obj module.
Looking at Marshall, it is a serialization format, which would let you modify type information in a potentially unsafe way — but no more or less than writing it to a file and reading it back, I think. I couldn't get at the site with the documentation, though, so didn't read up on the Obj module. > Without those two modules Ocaml is strongly typed. With those two > modules its less so. Personally, I would still consider it strongly typed: with Marshall, at least, you are going through the intermediary of a strongly typed set of routines and an external representation. This is like Perl: sure, you can mangle data in a weakly typed fashion, but only by stepping into a weakly typed language such as C or (un)pack, embedded in the bigger language. That is a good example, though. Regards, Daniel _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders