Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Robby Findler
It is a different way of thinking about protection, one that is more in line with the way such protections usually happen in Racket. In a language like Java, the class and the package a class is in both play a role in determining who has access to what, which is why things like 'protected' make se

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Matthias Felleisen
We use this via modules not via lets, which makes it syntactically simpler. -- Matthias On May 11, 2011, at 9:35 PM, Mark Engelberg wrote: > I played around briefly with define-local-member-name but it seemed > like a rather awkward way to achieve "protected"-ness. From the > example in the

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Mark Engelberg
I played around briefly with define-local-member-name but it seemed like a rather awkward way to achieve "protected"-ness. From the example in the help desk, it seems like the classes need to have some sort of let wrapped around them to share a non-public method between them. It seems like to set

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Robby Findler
Did you find define-local-member-name? Robby On Wed, May 11, 2011 at 7:32 PM, Mark Engelberg wrote: > On Wed, May 11, 2011 at 1:10 PM, David Van Horn wrote: >> Here are some struct definitions and a function, based on Land of Lisp: >> >> (struct monster (id [hit #:mutable]) #:transparent) >> (s

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Mark Engelberg
On Wed, May 11, 2011 at 1:10 PM, David Van Horn wrote: > Here are some struct definitions and a function, based on Land of Lisp: > > (struct monster (id [hit #:mutable]) #:transparent) > (struct orc monster (club) #:transparent) > (struct hydra monster () #:transparent) > (struct slime monster (sl

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Jay McCarthy
Ya, vanilla structs can't do that. It is possible for there to be no syntactic connection between a parent's definition (and uses of it) and an arbitrary child definition, so we can't even use gross expand phase state to communicate. I'm a big believer in prototype object systems as a foundation

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread David Van Horn
On 5/11/11 4:03 PM, Nadeem Abdul Hamid wrote: On Wed, May 11, 2011 at 3:45 PM, David Van Horn wrote: Is there a good way to do a functional struct updates with subtypes of a structure? There was some discussion about it a while ago in reference to struct-copy. The documentation has been updat

Re: [racket] Functional struct update with subtypes

2011-05-11 Thread Nadeem Abdul Hamid
On Wed, May 11, 2011 at 3:45 PM, David Van Horn wrote: > Is there a good way to do a functional struct updates with subtypes of a > structure? There was some discussion about it a while ago in reference to struct-copy. The documentation has been updated with some useful examples, including usage

[racket] Functional struct update with subtypes

2011-05-11 Thread David Van Horn
I think this has come up in the past, but I couldn't find anything. Is there a good way to do a functional struct updates with subtypes of a structure? _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users