News for hackers. Stuff that matters.
Re:Swift System Is Now Open Source by fiedzia on Friday September 25, 2020 @09:26PM (#24595672)
I find this style (Rust)) more readable end easier to extend:

RangeInclusive::new(1, 10) .filter(|x| x % 2 == 0) .for_each(|x|{ println!("{}", x); });

(though you could write it the same way, for i in 1..=-10 { if .. { .. }}

Re:Swift System Is Now Open Source by viktorcode on Saturday September 26, 2020 @02:15AM (#24596799)
The same can be written in Swift as

(1...10).filter { $0.isMultiple(of: 2) }.forEach { print($0) }