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.44k stars 1.47k forks source link

Future's => requires far too many parenthesis #5224

Closed dom96 closed 6 years ago

dom96 commented 7 years ago
import future

var SA = @["42"]
var SB = @["67"]
var i = 1

((proc (): var seq[string] =
  case i
  of 1: return SA
  else: return SB
)()) &= "Fifth"

(((() -> var seq[string]) => (
  case i
  of 1: return SA
  else: return SB
))()) &= "Fifth"

echo SA
Araq commented 6 years ago

I use it in my karax examples, () => (x = 3), it works and doesn't require too many ()s. I don't understand your point.

dom96 commented 6 years ago

My example demonstrates it.

Araq commented 6 years ago

Your examples seem artificial and convoluted.

dom96 commented 6 years ago

Meh, alright.