Stevenson, the populariser of the tales of the Arabian nights, has Dick tell the tale of Ali Baba and the Forty Thieves in Book 4, chapter 6 to help him escape from the ruined sea captain Arblaster, whose ship Dick and the outlaws had stolen.