title: get all fields of object
body: <p>Is it possible in racket to get all fields of an object at the same time?</p>
  
  <p>I would like basically to convert an object to a hash table with field names as keys and field values as values.</p>
  
  <p>I found a function (field-names obj), but then I don't know how to use the returned field names to get the values from the obj. The function <code>get-field</code> can be used to get the value of a field, but I dont know how to use it with a value:</p>
  
  <pre><code>&gt; (define x% (class object% (init-field x y) (super-new)))
  &gt; (define obj (make-object x% 1 2))
  &gt; (get-field x obj)
  1
  &gt; (field-names obj)
  '(y x)
  &gt; (define field-name (second (field-names obj)))
  &gt; field-name
  'x
  &gt; (get-field field-name obj)
  get-field: given object does not have the requested field
    field name: field-name
    object: (object:x% ...)
    errortrace...:
    context...:
      /usr/lib/racket/collects/racket/private/class-internal.rkt:4906:0: obj-error29
      /usr/lib/racket/collects/racket/private/misc.rkt:87:7
  </code></pre>