A New Beginning

Didn’t feel like working this afternoon, so instead, I updated my blog software to WordPress 2.5.

Here’s some Scheme code for all of you fans out there:

(define-record-type keystroke
  (%make-keystroke %value %meta?)


  keystroke?
  (%value char-value)
  (%meta? meta?))

(define-record-discloser keystroke
  (lambda (k)
    `(


 Keystroke ,(keystroke->sexpr k) ,(keystroke-hash k) )))

(define
  

  (parse-key form)
  (if (list? form)
      (let ((tag (car  form))


            (val (cadr form)))
        (case tag
          ((


 control) (


 %control  (parse-key val)))
          ((meta)    (


 %meta     (parse-key val)))
          ((key)


      (%key     val))
          (


 else


       (error "This is not a valid key form " tag))))
      (%key form)))

Leave a comment