Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I think he's using a logical implication notation "|=". as in: A => B logically implies that: ~B => ~A

He just decided to use "/=" rather than "|="...so it looks weird...



sort by: page size:

This one tripped me up too. I'm guessing he meant `a |= b`.

Of course he meant that. My point was that `if !a && b { a = true; }` is a silly way to write `a = a || b;`

Yeah, this post is confusing. It reads as though I should expect `is` to be the same operator as `==`. But that's completely off. It's not that the integers are weird, it's that OP is misusing an operator. The topic could have been an explanation of what the `is` is, instead it's confusing and not helpful.

Despite a CS major, I still get confused about the meaning of |– vs. |=, and about the respective meta-syntactic levels of the variables used. Ironically, one issue for me is the lack of explicit typing in the notation itself.

He names references in his post. I highly doubt he’s confused about the difference between is and ==. It’s a weird leak of interpreter details that could, in very narrow situations, cause a bug.

The proposal is for operator =>

I think it’s not an April Fool’s joke, but this looks awfully confusable with >=.


Am I missing something? '==' has a higher precedence than '||', so it should always evaluate as true.

I thought it was

(a / b) != (a / b)


> Also, speaking of notation, I wonder why you used ':=' instead of '=' to define 'f'. There is no computation going on, right?

In math, := is typically used to denote a definition. Using equality (=) only makes sense if both sides of the equality sign already have a definition.


> The other way isn't really definable as an assignment mathematically.

It's an equality sign. See also, := and unification.


You've simply conflated symbols (ie, ˜ ? = etc).

The original uses shorthand "~=" for coarse equality, in lieu of {option+x}.


> `a = a + b` and `a += b` are completely different operations

Getting off-topic, but IMO that’s a major design flaw in the language. Some others agree, e.g. https://twitter.com/joepolitz/status/1304992696293978112


Ah, I missed that part. I was going off the keyword == symbol rules, which are waaaaay more restrictive. Thanks!

> he changed the meaning of the equals sign.

Into what?


I believe the general consensus is that the double dot notation might not have been the best idea.

FWIW it's mostly used for inequalities like `(a . <= . b)` which some people find easier to read than `(<= a b)`.

But `<=` allows more arguments as in `(<= a b c d)` and here the double dot notation can't be used.


> inequality x!=y is not used at all, because it is two chars. instead, we test with x-y, which holds true when operands differ

I think this is the line in the document that represents his coding style the most. Sacrificing legibility for plebs to save one character per comparison.


The author unfortunately has a misunderstanding of equality.

Quoting him, "The equal sign is another mathematical concept that’s often misunderstood. It means, of course, that whatever is on either side of the equal sign is equivalent." This is actually wrong.

The equals sign (=) is a shorthand for stating not that the two sides are equivalent, but that they are the same (i.e., they are equal).

If they were just equivalent, we would use another sign, like = (unicode U+2261).


Actually it is, he assigned it in the parent post, == is the equality test. :)

Weirdly enough in mathematics it's far more common to define <= instead of <. With a<b simply being shorthand for 'a<=b and not b<=a'. The definitions also seem to be simpler that way.
next

Legal | privacy