Wylly, William, Attorney-General in the Bahamas