Partly reimplemented and ported to SBCL