[0]: https://www.reddit.com/r/rust/comments/5penft/parallelizing_...
[0]: https://www.reddit.com/r/rust/comments/5penft/parallelizing_...
type ImmutableTreeListᐸElementTᐳ struct
"If you look closely, those aren't angle brackets, they're characters from the Canadian Aboriginal Syllabics block, which are allowed in Go identifiers. From Go's perspective, that's just one long identifier."Simultaneously amusing and disturbing. Is there an award for which one might nominate this person?
Maybe the Unicode Consortium should change it, but for now, Canadian Aboriginal is the correct term.
Just do a find and replace, refactoring is easy and trying to argue on the internet about it is tiring.
> trying to argue on the internet about it is tiring.
… exactly.
At the very least they could have used the cute Japanese 「quotation marks」 to avoid confusion.
Definitely the correct response.
Also,
> c++ allows 0-width spaces in variable names. Where's your god now?
Nowhere. We have strayed maximal distance from god's light and are currently in orbit around Satan.
Is that true though ?
> A valid identifier must begin with a non-digit character (Latin letter, underscore, or Unicode character of class XID_Start) and may contain non-digit characters, digits, and Unicode characters of class XID_Continue in non-initial positions. Identifiers are case-sensitive (lowercase and uppercase letters are distinct), and every character is significant. Every identifier must conform Normalization Form C.
This seems to be the only limitation for that to be true.
So the question is does 0-width space (U+200B) survive canonical decomposition, followed by canonical composition?
It feels like it does to me.
Clang logs a warning about potentially invisible characters every time you use them. g++ just compiles the code without warning, even with -Wall and -Wpedantic.
What clang _doesn't_ warn for, is the use of the left-to-right override character. This can be used to confuse the victims of your code even more.
Upon further investigation(I think IntelljIDEA reported Unicode value) I've found out that the 'semicolon' I copied is a Greek character that looks exactly like semicolon.
I wonder how people on vim/emacs deal with situation like this.
And in my case, even if compiler / interpreter reported about an invalid syntax - I would not think of checking the unicode codepoint as it the character appeared to look exactly like semicolon.
[0] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p194...
I guess that's a lot of ifs/ands but it's interesting that one could have future proofed their code if their bet on syntax paid off
It might be useful for editors and compilers to check for tricky Unicode (lookalikes for common characters, atypical changes in direction, invisible spaces or other formatting control codes, etc.) in this era of copy/paste coding.
But Go having actual generics, and accordingly removing some need for codegen, is not a bad thing at all.
I for one won't be using more advanced functional coding though, it's a lot more difficult to read / parse and the language is not designed with functional programming in mind. I'm sure people are already working on a functional programming library so you can do map / reduce / filter and the like, but readability and performance will be dreadful.
Next thing you know they will try to force me into structured programming (I'm sure there are people already working on do...while). They can pry goto from my dead cold hands.
def traverseImpl[F[_], A, B](fa: Option[A])(f: A => F[B])(implicit F: Applicative[F]) =
fa map (a => F.map(f(a))(Some(_): Option[B])) getOrElse F.point(None)That's the type. The expression makes little sense to me, but I suspect you removed a bunch of dots and maybe some parens, and it should actually look like this:
fa.map (a => F.map(f(a))(Some(_): Option[B])).getOrElse(F.point(None))
So this function essentially just operates on an option value inside of some functorial context. This seems like a building block function that you might use often, but probably not write very frequently.(If you didn't remove anything, then I suppose this language has infix 'map' and 'getOrElse' operators. I think that's bad, but it's not related to the type system.)
Idea, I think, is to make the repl look more like a CLI, but it also may be a fight against punctuation.
Oh gosh oh gosh zaglo variables please no
If you are interested in generics in Go 1.18 please read https://go.googlesource.com/proposal/+/refs/heads/master/des...