<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>50513</integer>
    </number>
    <user>
      <string>baggito</string>
    </user>
    <title>
      <string>make-load-form with a hash-table. how is this supposed to work?</string>
    </title>
    <contents>
      <string>
(let ((saved
       (with-output-to-string (out)
         (let ((a (make-hash-table)))
           (loop for key across &quot;abcdef&quot;
              for val from 1
              do (setf (gethash key a) val))
           (multiple-value-bind (create initialize) (make-load-form a)
             (with-standard-io-syntax
               (print create out)
               (print initialize out)))))))

  (format t &quot;Wrote output:~%~a~&amp;--END--~%&quot; saved)

  (with-input-from-string (in saved)
    (let ((create-form (read in))
          (init-form (read in)))
      (format t &quot;Eval from create form:~%~2t~A~%and init form:~%~2t~a~%&quot;
              create-form init-form)
      (let ((created (multiple-value-list (eval create-form)))
            (initialized (multiple-value-list (eval init-form))))
        (format t &quot;Create form returned values:~%~2t~a~%and init form returned values:~%~2t~a~%&quot;
                created initialized)))))


#|

Wrote output:

(MAKE-HASH-TABLE :TEST (QUOTE EQL) :SIZE (QUOTE 16) :REHASH-SIZE (QUOTE 1.5) :REHASH-THRESHOLD (QUOTE 1.0) :WEAKNESS (QUOTE NIL)) 
(SB-IMPL::%STUFF-HASH-TABLE #.(SB-IMPL::%STUFF-HASH-TABLE (MAKE-HASH-TABLE :TEST (QUOTE EQL) :SIZE (QUOTE 16) :REHASH-SIZE (QUOTE 1.5) :REHASH-THRESHOLD (QUOTE 1.0) :WEAKNESS (QUOTE NIL)) (QUOTE ((#\f . 6) (#\e . 5) (#\d . 4) (#\c . 3) (#\b . 2) (#\a . 1)))) (QUOTE ((#\f . 6) (#\e . 5) (#\d . 4) (#\c . 3) (#\b . 2) (#\a . 1)))) 
--END--
Eval from create form:
  (MAKE-HASH-TABLE TEST 'EQL SIZE '16 REHASH-SIZE '1.5 REHASH-THRESHOLD '1.0
                   WEAKNESS 'NIL)
and init form:
  (%STUFF-HASH-TABLE #&lt;HASH-TABLE :TEST EQL :COUNT 6 {A7A9851}&gt;
                     '((f . 6) (e . 5) (d . 4) (c . 3) (b . 2) (a . 1)))
Create form returned values:
  (#&lt;HASH-TABLE :TEST EQL :COUNT 0 {A7AB8C1}&gt;)
and init form returned values:
  (#&lt;HASH-TABLE :TEST EQL :COUNT 6 {A7A9851}&gt;)

|#</string>
    </contents>
    <universal-time>
      <integer>3403507640</integer>
    </universal-time>
    <channel>
      <string>#lispcafe</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </paste>
  <annotation>
    <number>
      <integer>1</integer>
    </number>
    <user>
      <string>faxathisia</string>
    </user>
    <title>
      <string>can you do it this way?</string>
    </title>
    <contents>
      <string>CL-USER&gt; (defun temp-hash-table ()
           (let ((h (make-hash-table)))
             (setf (gethash 0 h) 'a)
             (setf (gethash 1 h) 'b)
             (setf (gethash 2 h) 'c)
             h))
STYLE-WARNING: redefining TEMP-HASH-TABLE in DEFUN
TEMP-HASH-TABLE
CL-USER&gt; (temp-hash-table)
#&lt;HASH-TABLE :TEST EQL :COUNT 3 {1190F461}&gt;
CL-USER&gt; (multiple-value-bind (create init) (make-load-form *)
           (eval create)
           (eval init))
#&lt;HASH-TABLE :TEST EQL :COUNT 3 {1190F461}&gt;
</string>
    </contents>
    <universal-time>
      <integer>3403513216</integer>
    </universal-time>
    <channel>
      <string>#lispcafe</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </annotation>
</paste-with-annotations>