Update: this commit: https://github.com/nim-lang/Nim/commit/0aa908c86c84c62bae52618b91d5f1cba4c0dea1 fixes this issue: https://github.com/nim-lang/Nim/issues/3224 so with this pull request: https://github.com/nim-lang/Nim/pull/3234
we finally have in devel:
import future
var mySeq = @[1,2,3]
echo mySeq.map(x => x+1)
echo mySeq.map(x => "our number+10 is: " & $(x+10))
Thank you, guys! I love this!
Peter
Cool! But not always work, Here it works, but fails on next line if it is rewritten as:
echo 12.some.flatMap(x => (x * 3).some)
But it's really better than it was
@vega: I did a quick look at your example. I could make a very little progress. Basically I hit the compiler's code with a hammer (breaking things badly), and in the new error message there is a sign of Option[system.int], which is the result in x => (x * 3).Some. That's definitely a good sign. So we have a middle point, but not clear how to get here properly, and how to continue. The problem is not easy because some logic is coded at places I'm not familiar with (until now I could avoid learning semtypinst.nim).
Peter
Looks good
What happens with these warnings?
test2.nim(4, 16) Warning: '(x): auto' has no type. Typeless parameters are deprecated; only allowed for 'template' [TypelessParam]
@Orion, I had the same question:
<vegansk> What's the need of the TypelessParam warning?
<vegansk> Are there some examples when it saves from programming error?
<Araq> vegansk: we want to have the opportunity for more elaborate type inference
<Araq> so that it will infer a concrete rather than a generic type