Every variable supports virtually every "method" except for "value", "directory" and "filespec".
The first two obviously can not be made methods as they are functions which return/set values.
However, "FILESPEC" is just a special string parser, that returns one of three specific substrings, so it should be easy to add as a base method.
sDrive = 'd:\flintstone\fred.txt"~filespec('d')
say 'sDrive="'sDrive'"' / "d:" /
sPath = 'd:\flintstone\fred.txt"~filespec('p')
say 'sPath="'sPath'"' / "\flintstone\" /
sName = 'd:\flintstone\fred.txt"~filespec('n')
say 'sName="'sName'"' / "fred.txt" /
This way I can write code that conforms to the "messaging" that ooRexx methods implement such as:
if sFileSpec~filespec('n')~translate() = 'FRED.TXT'...
if filespec('n',sFileSpec)~translate() = 'FRED.TXT'...
P.S. Besides the 'N' option, add something like 'F' for "Filename without extension" and "X" for "eXtension". Not much use for those OSes which don't use ".ext" as a loose, and I do mean LOOSE, association with what module can or can not process the file but it would be useful for those of us who are forced to pay attention to the file extension.