or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
R&T / Deep Equality discussion
Three contrasting implementations
Question 1: Does a deep equality operator make Records and Tuples better in terms of implementation?
Problem 1: if R&T are objects, what happesn to builtin methods?
a ~ b, where a = {}, b = {}, will be true
proposal: Change the semantics, to check for immutability
Proposal 2: Special casing builtin methods to treat records and tuples specially, feels wrong. We should instead introduce new methods that check deep equality, as they are functionally different.
proposal 3:
Counter idea: If records and tuples are primitives, then one way we can implement deep equality is by casting to a record or a tuple for various complex types. This is equivalent to
Idea: Introduce interned objects
Atomized objects are extractions of the observable surface area of an object. They are not equal to their source object, they are an immutable representation of their detectable surface area.
In this case - The R&T syntax becomes a sugar for atomized objects.
A shim:
Example with proxies:
What we introduce is not immutability, but object identities tied to structure.
https://github.com/PapenfussLab/bionix
Question 2: Does having a deep equality operator make other things in the language better?
rough syntax
Notes:
The shim so far