News for hackers. Stuff that matters.
Re:Swift System Is Now Open Source by kbenson on Friday September 25, 2020 @08:52PM (#24595518)
So it looks like it's a general modifier to a range type, so can be used where those work. That's slightly better, but if filter exists, why not just use that?

One of the biggest criticisms that Perl gets is that there's so many different ways to do things, and that's somewhat deserved, so the question is what does "where" offer that "filter" doesn't other than another keyword and concept you have to learn to understand the language? What's the point if it's not really that much more expressive or clear?

> struct Vector<T> where T: Numeric

Is this really the same thing? This seems like a case where the same word is used to mean something else, even if they are loosely conceptually the same.

Re:Swift System Is Now Open Source by solidsnack9000 on Saturday September 26, 2020 @12:27AM (#24596412)
It isn't actually a modifier to a range type -- it modifies other constructs, like looping or conditionals. The examples don't show it but literally any condition can go in the where clause, even something like `where random() % 7 == 2`.
Re:Swift System Is Now Open Source by jiofih on Friday September 25, 2020 @09:00PM (#24595556)
Better learn a new, generic concept than obscure syntax I’ll see combined 1000 different ways on the same codebase.