Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 1cf5965

Browse files
author
Max Heiber
committed
Update wording of 'boxing'
Clarify that the `Record` and `Tuple` namespaces are not constructors and don't have instances.
1 parent 8cf3f25 commit 1cf5965

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ assert(#{ a: 1, b: 2 } === #{ b: 2, a: 1 }); // not yet specified whether this p
250250

251251
This is related to [Ordering of properties](#ordering-of-properties).
252252

253-
# `Record` and `Tuple` boxing objects
253+
# `Record` and `Tuple` Globals
254254

255-
We add to the global namespace two boxing objects that you can use to manipulate those value types. Those boxing objects have multiple properties that are in line with how those value types behave.
255+
We add to the global namespace two objects that you can use to manipulate records and tuples. Those objects have multiple properties that are in line with how records and tuples behave.
256+
257+
The new globals are not constructors, and are distinct from the `Record` and `Tuple` types.
258+
259+
Unlike `Boolean` and `String`, there is no such thing as a boxed `Record` or `Tuple`. For example, `Object.assign("hello")` silently creates a mutable `String` instance, but `Object.assign(#{})` produces a `TypeError`, just like `Object.assign(undefined)`.
256260

257261
## Instantiation and converting from non-const types
258262

0 commit comments

Comments
 (0)