News for hackers. Stuff that matters.
Re:Modern Functional Programming: The Onion Architecture by thinkpad20 on Thursday September 29, 2016 @06:00PM (#12609143)
I'm not sure how D's purity system works, but that doesn't seem very pure to me. Mutating the database object is a globally visible effect, after all.
Re:Modern Functional Programming: The Onion Architecture by buzzybee on Thursday September 29, 2016 @09:18PM (#12609987)
The guarantee it's making is that it's not going to manipulate program state that is outside the scope of "db". That is a pretty big deal for a systems developer since, as I discovered while working with D, many standard library functions that you wouldn't have given a second thought about happen to do unpure things like set a processor flag. We aren't even talking about your own program.

From an abstracted viewpoint, it's not great, since a whole database covers potentially a lot of scope, and you may not want to care about the details of your floating point calculations in hardware, but in a concrete sense this is totally correct!