mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 09:14:00 +00:00
the big renamefest: first steps
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
discard """
|
||||
output: '''foobarfoobarbazbearbazbear'''
|
||||
output: '''foobarfoobar
|
||||
bazbearbazbear
|
||||
1'''
|
||||
cmd: "nimrod $target --threads:on $options $file"
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
|
||||
proc computeSomething(a, b: string): string = a & b & a & b
|
||||
proc computeSomething(a, b: string): string = a & b & a & b & "\n"
|
||||
|
||||
proc main =
|
||||
let fvA = spawn computeSomething("foo", "bar")
|
||||
@@ -15,3 +17,19 @@ proc main =
|
||||
|
||||
main()
|
||||
sync()
|
||||
|
||||
|
||||
type
|
||||
TIntSeq = seq[int]
|
||||
|
||||
proc t(): TIntSeq =
|
||||
result = @[1]
|
||||
|
||||
proc p(): int =
|
||||
var a: FlowVar[TIntSeq]
|
||||
parallel:
|
||||
var aa = spawn t()
|
||||
a = aa
|
||||
result = (^a)[0]
|
||||
|
||||
echo p()
|
||||
|
||||
Reference in New Issue
Block a user