←back to thread

228 points Retro_Dev | 1 comments | | HN request time: 0.208s | source
Show context
ww520 ◴[] No.44465800[source]
One issue I have with the old reader/writer pattern is that it is not easy to store them in a struct. Reader and writer are passed into a function as 'anytype' which implements any of the read() or write() functions. Often time in a struct's init() function, I want to take in a reader/writer and store it for later use. It's close to impossible since I don't know what type of the field of the struct to store them.

Does the new change make it easier to store reader/writer in a struct?

replies(2): >>44465955 #>>44466407 #
AndyKelley ◴[] No.44465955[source]
Yes, that is precisely what "non-generic" means.
replies(1): >>44467276 #
1. ww520 ◴[] No.44467276[source]
That's excellent! Thanks for the changes.