I was looking for a way to transliterate(translate) English numbers to Persian numbers in Go. Such functionality is usually found in programming languages, but I wasn't expecting too much from Go.
It's very easy to do in Raku:
say 567.trans: '0'..'9' => '۰'..'۹' =output ۵۶۷ say TR/0..9/۰..۹/ given 567 =output ۵۶۷ For Go I found xstrings module which has a Translate function. But the solution I came up with was using NewReplacer function from Go's internal strings module:After I finished watching Daniel Sockwell's FOSDEM 2022 Raku presentation, I thought this is a good opportunity to play with Raku's slangs, something I hadn't done before.
What is Daniel's talk(and upcoming module) and my module going to solve?
Write less but more readable test code Get a useful test description and failure message If you use cmp-ok, you get a good error message; but without a test description it's sometimes hard to understand.