nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.22k stars 1.46k forks source link

Add logical AND-assignment and logical OR-Assignment #23738

Closed juancarlospaco closed 1 day ago

juancarlospaco commented 1 week ago
Araq commented 1 week ago

Why? Nim programmers should write Nim code that we compile to JS, not JS code.

juancarlospaco commented 1 week ago

For interop purposes with the browser, it is useful for big heavy objects. I mean there's emit for C targets and people don't go emit'ing whole modules.

juancarlospaco commented 1 day ago

@Araq Would you prefer to use a name like andAssign instead of &&= ? 🤔

Araq commented 1 day ago

No, I don't get the point at all, it's not about the name. Javascript uses + for string concats, should we also import its plus operator then? It just makes no sense...