This is a slightly more advanced version of my previous post on creating callable variants of functions in Ruby while avoiding scope problems . In today's instance, I was creating an error reporting system for a program I was writing. The error reporting, of necessity, had to emit a message to indicate what was going on. While some errors would be unique messages that only occurred once during the program, other errors could be grouped. For example, one group was "incorrect number of parameters supplied". There were several error messages within my program that fell into this category, so I didn't want to type out the exact same wording each time. I wanted to create a function that could report this sort of error indicating where it happened (of course I had to supply parameters to the messages to show the context). So here is a very basic sketch of the sort of thing I was doing. I'm writing this here so that I can go back to it easily later. The item I'm re...
Things about code and tech that I'm learning along the way. You can also find this blog in Gemini space at gemini://gemlog.blue/users/verachell/