Racket inorder(tree) returns list
<p>I created an inorder function like this:</p>

<pre><code>(define inorder
  (λ (tree) 
            (unless(empty? (node-left tree)) (inorder(node-left tree)))
            (print (node-x tree))
            (unless(empty? (node-right tree)) (inorder(node-right tree)))
  )
)
</code></pre>

<p>How can I create a list with all the node-x tree elements instead of printing them. I need my inorder function to return a list of those elements.
I tried using an auxiliary function but it didn't work...</p>