News for hackers. Stuff that matters.
Re:Switching to Elixir by andsbf on Thursday November 09, 2023 @11:00PM (#38214890)
`...If you call model.update(params) in Ruby, then it returns false if it fails and updates model.errors with what went wrong. Mutable state.`

This is Rails stuff, not Ruby

Re:Switching to Elixir by krainboltgreene on Thursday November 09, 2023 @11:31PM (#38215063)
True, you could implement Ecto exactly in Ruby, except you'd be writing effectively Elixir and every library released that got close to this in the 15 years I've been doing Ruby has been either disliked or disregarded. Each with less contributor activity in their lifespan than a month of ActiveRecord attention.
Re:Switching to Elixir by ljm on Saturday November 11, 2023 @03:54PM (#38234398)
Yeah, the example is Rails-specific but Ruby is full of methods that mutate existing state. Most of the time they're marked with `!` at the end, but not always.