[racket] Some struct questions

From: Harry Spier (vasishtha.spier at gmail.com)
Date: Sun Jul 15 11:40:26 EDT 2012

1) In section 8 of the Racket reference there is this example:
(define-struct tree (val left right))

> (match (make-tree 0 (make-tree 1 #f #f) #f)
    [(tree a (tree b  _ _) _) (list a b)])

'(0 1)

but I wasn't able to find any reference in the documentation to a constructor form make-struct-id .  I'm assuming that in the above example 
(match (make-tree 0 (make-tree 1 #f #f) #f)
 is equivalent to 
(match (tree 0 (tree 1 #f #f) #f)

Is that correct? Is make-struct-id  a deprecated form of the constructor procedure struct-id?

2) In a module which contains a structure, lets call it  "structure-a" I can have the statement:
(provide (struct-out structure-a))
which provides the constructor procedure and the getters and setters to structure-a
but I can also have the statement
(provide structure-a)
which only provides the constructor function.
Are there any cases where you would want to have (provide structure-a) rather than (provide (struct-out structure-a)) ?

Harry Spier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120715/5b441e92/attachment.html>

Posted on the users mailing list.