For the slash, may I commend to you my very well debugged and mature slash functions in the openlilylib library? They are quite general anbd have lots of parameters, If you don't have openlilylib already installed, it is not daunting as people seem to think. It's easy to install and use. You can pick the modules you need.
Not to disparage the slash code in this thread, but a bit of reinventing a wheel here!
I suppose a problem with openlilylib is that it is not well known what it contains. Not sure how we solve that problem.