Your suggestion gives me $_Filename of /usr/local/share/mma/lib/stdlib/fastblues.mma. Might be more useful to have just "fastblues"?
I don't think so. I really expect something called filename to return a filename.
Nevertheless the idea of having a macro that provides "fastblues" is interesting. I would call it $_Style, not filename. Style FastBlues consists of the grooves FastBlues, FastBluesWalk, FastBluesEnd, ....
And the library file could explicitly define the style with a "Style FastBlues" command...
And it could default to the file basename. Cute...
And, since you can compile either "test" or "test.mma"
Yes, using MMA.file.locFile(gbl.infile, None) is a good idea.
My initial reaction is to strip both the path info and the .mma suffix.
Then you would lose the distinction between /usr/local/share/mma/lib/stdlib/fastblues.mma (the library file) and fastblues.mma (the test program). And that's where it's all about.