exploring-reasonml icon indicating copy to clipboard operation
exploring-reasonml copied to clipboard

Chapter: Basic values and types

Open rauschma opened this issue 7 years ago • 3 comments

rauschma avatar Feb 07 '18 06:02 rauschma

Should last sentence be === is the preferred equality operator (unless you really want to compare references). instead of == is the preferred equality operator (unless you really want to compare references).

xin-nie avatar Feb 08 '18 21:02 xin-nie

The text is correct as is, === compares references whilst == compares values.

farisk avatar Feb 09 '18 22:02 farisk

After some discussion on Discord, I think the claim

ReasonML strings are encoded as UTF-8 and not compatible with JavaScript’s UTF-16 strings

Is wrong. It also goes against the docs here:

Since a Reason string maps to a JavaScript string, you can mix & match the string operations in both standard libraries

What really seems to happen is that if you use Reason string literals, it encodes in utf-8 but saves it to a JS-string. So the underlying type does support Unicode, and there is full interoperation between JS-strings and Reason strings. You just need to use the JS syntax to express unicode.

RasmusKlett avatar Mar 16 '18 13:03 RasmusKlett