Add Crystal examples, and in the process refactor the Ruby ones.
digitalextremist opened this issue · comments
Noticed while referencing the MDP
examples that they are in need of refactoring to not confuse, or continue mistakes. Just two examples, unless I am mistaken:
This is the only place where @expect_reply
exists, meaning it's essentially unused, and an artifact from copying and pasting another example:
zguide/examples/Ruby/mdwrkapi.rb
Line 27 in cea9f85
zguide/examples/Ruby/mdwrkapi.rb
Line 39 in cea9f85
Then in the same file, instance variables are set for what ought to just be constants on the class, such as @timeout
vs. TIMEOUT
or @reconnect
vs. RECONNECT
, etc.
But I found these examples by using Ruby
code to demonstrate patterns I was transposing as Crystal
. Rather than refactor Ruby
for its own sake, it would make more sense to add Crystal
examples made from the Ruby
ones, and just know that refactoring will also be involved.
Adding an issue in hopes of coming back later myself, and making a contribution. Have loved 0MQ
for ages now, and am grateful that Hintjens
lives on so presently, not only in the guide on my desk, but in the movement which only needs updated language examples over time.