[racket] Some struct questions
1) In section 8 of the Racket reference there is this example:
-------------------------------------------
Examples:
(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)) ?
Thanks,
Harry Spier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120715/5b441e92/attachment.html>