the.bay.news

[terminology] "pure"

The Rust Programming Language Forum
[terminology] "pure"
Is the following closure "pure"? let mut data = Arc::new(Mutex::new(0)); let block_size = |depth| -> usize { // the following is not affected by // input, nor does affect output let v = data.lock(); *v = (*v).wrapping_add(1); drop(v); // dummy mapping depth + 1 }; I.e. does "pure" refer only to input/output, or does it refer to everything within the function body? XY: Documentation puts a "pure" constraint on a closure. Due to the nature of the closure it may be used for thin...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.