peder has quit [Read error: Connection reset by peer]
ssh0732 has joined #ruby
GreenResponse has joined #ruby
pookie has quit [Remote host closed the connection]
CRISPR has joined #ruby
CRISPR has quit [Ping timeout: 272 seconds]
EIRK has joined #ruby
gemmaro has quit [Ping timeout: 260 seconds]
gemmaro has joined #ruby
Linux_Kerio has quit [Ping timeout: 248 seconds]
TomyWork has joined #ruby
<nakilon>
yesterday spotted, that according to ruby --help, the truffleruby does not enable frozen_string_literals by default
<nakilon>
that is nice, this feature is awful
<nakilon>
but I would love to see some automatic freeze on the values obtained with attr_reader
<nakilon>
or maybe freezing them inside initialize, hmmm
<nakilon>
havenwood: I scrolled through but didn't find the namespaces within the object syntax, i.e. myobj.namespace.mtd
<nakilon>
or is it irrelevant to what I was talking about recently
<nakilon>
o0x1eef: active_betrayal
<o0x1eef>
Lol
<havenwood>
nakilon: An attr_reader doesn't expose itself as a special method on the Ruby side. You can introspect fancy ways, but the simple way is to define your own `frozen_attr_reader` or whatnot. You can write a C extension to tell, and could write a gem that exposes Method#attr_reader? I suppose but they're just regular methods from the Ruby side of
<havenwood>
things.
<havenwood>
I did expect Data members to be frozen. It's kinda funny they're also not exposed as Enumerable like a Struct.
<havenwood>
The easiest way to free Data members is to use Data#deconstruct, which feels a bit odd.
<havenwood>
deconstruct.each(&:freeze)
<havenwood>
Alternatively, you can iterate through members.
eddof13 has joined #ruby
<havenwood>
members.each { send(it).freeze }
<havenwood>
It can be nice to do in an Data#initialize method. I think it would be reasonable to have a `freeze_members: true` option for Data.define.
<havenwood>
You could also have a `frozen: true` for `attr_reader`, but you can also add your own when needed with super.