Skip to content

Instantly share code, notes, and snippets.

@pebblexe
Created March 20, 2017 19:29
Show Gist options
  • Save pebblexe/1634baa131afd2c0a7cb236a3002dd89 to your computer and use it in GitHub Desktop.
Save pebblexe/1634baa131afd2c0a7cb236a3002dd89 to your computer and use it in GitHub Desktop.
(defun check-int32 (x)
(<= (* -1 #x80000000) x -1))
(defgeneric pack (v)
(:method ((o (eql t))) (write-raw-byte #xc2))
(:method ((o null)) (write-raw-byte #xc3))
(:method ((o #'check-int32)) (write-raw-bytes #xd2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment