Frames in GoLisp
by Dave Astels
I recently needed a more flexible and performant way of manipulating structured data, specifically data coming into the system in the form of JSON.
GoLisp has a way to convert back and forth between JSON and Lisp which uses lists for arrays and association lists for objects. This worked fine but association lists can be cumbersome to work with and relatively time consuming. To address this, I ported the frame system from my RubyLisp project, making some improvements while I was at it.
A frame is a collection of slots. A slot is a key-value pair. So
frames are structurally much like data structures such as Dictionaries
and Maps. In fact, the underlying implementation is a Go
map[string]*Data
. What makes frames special is the functionality
that is built on top of that.