Skip to content

Instantly share code, notes, and snippets.

@JustinTulloss
Created March 20, 2009 07:02
Show Gist options
  • Save JustinTulloss/82257 to your computer and use it in GitHub Desktop.
Save JustinTulloss/82257 to your computer and use it in GitHub Desktop.
; Using "let" here, since in my real code I use the reference later.
; You could use "doto" if you just wanted to do a bunch of database
; operations and then close the db.
(let [pref-db (HDB.)]
(.open pref-db "user-prefs.hdb" (bit-or HDB/OWRITER HDB/OCREAT))
(.put pref-db "Hello World" "Saying Hi! to the big old world out there")
(println (.get pref-db "Hello World"))
(.close pref-db))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment