diff --git a/CHANGELOG.md b/CHANGELOG.md index e3077a4ee4..31852cfa3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## V 0.3.3 - -*Not yet released* - - vfmt now supports `// vfmt off` and `// vfmt on` for turning off the formatting locally for *short* snippets of code. Useful for keeping your carefully arranged matrices in tact. +*Not yet released* +- `go foo()` has been replaced with `spawn foo()` (launches an OS thread, `go` will be used for + upcoming coroutines instead). +- vfmt now supports `// vfmt off` and `// vfmt on` for turning off the formatting locally for *short* snippets of code. Useful for keeping your carefully arranged matrices in tact. + ## V 0.3.2 *31 Oct 2022* - New simplified string interpolation: `println("Hello, {name}!")`. It will be the only way, old syntax (`${name}` and `$name`) diff --git a/vlib/v/fmt/tests/chan_ops_keep.vv b/vlib/v/fmt/tests/chan_ops_keep.vv index facd926336..ef045228bd 100644 --- a/vlib/v/fmt/tests/chan_ops_keep.vv +++ b/vlib/v/fmt/tests/chan_ops_keep.vv @@ -39,7 +39,7 @@ fn do_rec_calc_send(chs []chan i64, sem sync.Semaphore) { fn test_channel_array_mut() { mut chs := [chan i64{}, chan i64{cap: 10}] sem := sync.new_semaphore() - go do_rec_calc_send(chs, sem) + spawn do_rec_calc_send(chs, sem) mut t := i64(100) for _ in 0 .. num_iterations { chs[0] <- t @@ -57,7 +57,7 @@ fn test_channel_array_mut() { sem.wait() assert t == 100 + num_iterations ch2 := chan mut St{cap: 10} - go g(ch2) + spawn g(ch2) } fn g(ch chan mut St) { diff --git a/vlib/v/fmt/tests/chan_or_keep.vv b/vlib/v/fmt/tests/chan_or_keep.vv index 27af5550d3..4d12505bab 100644 --- a/vlib/v/fmt/tests/chan_or_keep.vv +++ b/vlib/v/fmt/tests/chan_or_keep.vv @@ -24,7 +24,7 @@ fn do_send_2(ch chan int, val int) ?int { fn main() { ch := chan int{} - go f(ch) + spawn f(ch) mut s := 1 for { s = do_send(ch, s) or { break } diff --git a/vlib/v/fmt/tests/go_stmt_keep.vv b/vlib/v/fmt/tests/go_stmt_keep.vv index e4041567cf..8fde1ff7f3 100644 --- a/vlib/v/fmt/tests/go_stmt_keep.vv +++ b/vlib/v/fmt/tests/go_stmt_keep.vv @@ -2,7 +2,7 @@ import sync fn go_with_anon_fn() { wg.add(1) - go fn (mut wg sync.WaitGroup) { + spawn fn (mut wg sync.WaitGroup) { wg.done() }(mut wg) wg.wait() diff --git a/vlib/v/fmt/tests/select_keep.vv b/vlib/v/fmt/tests/select_keep.vv index 4a5abf77f0..956ecf4ec7 100644 --- a/vlib/v/fmt/tests/select_keep.vv +++ b/vlib/v/fmt/tests/select_keep.vv @@ -82,7 +82,7 @@ fn test_select_blocks() { } assert r == true assert t == true - go f2(ch2, ch3, sem) + spawn f2(ch2, ch3, sem) n := <-ch3 assert n == 23 ch2 <- St{ @@ -90,7 +90,7 @@ fn test_select_blocks() { } sem.wait() stopwatch := time.new_stopwatch() - go f1(ch1, ch2, ch3, ch4, ch5, sem) + spawn f1(ch1, ch2, ch3, ch4, ch5, sem) sem.wait() elapsed_ms := f64(stopwatch.elapsed()) / time.millisecond assert elapsed_ms >= 295.0