[racket] Are there any functional structs in Racket

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Wed Oct 20 13:39:44 EDT 2010

It's not in the student languages, and I'm not sure I like the name
from a teaching perspective ("copy" is too much of an implementation
issue).

On Wed, Oct 20, 2010 at 12:58 PM, Everett Morse <webj2 at unoc.net> wrote:
> On 10/20/2010 09:05 AM, Stephen Bloch wrote:
>>
>> On Oct 20, 2010, at 3:16 AM, Nikita B. Zuev wrote:
>>
>>
>>>
>>> I'm looking for a way to use Raket's structs in a functional way.
>>> Example:
>>>
>>> (define-struct person (name age))
>>> ...
>>> (define (person-age-set p proc)
>>>  (make-person (person-name p)
>>>               (proc (person-age p))))
>>>
>>
>> Matthias has been talking for some time about adding this to the student
>> languages; I don't know how far it has progressed.  It should be an easy bit
>> of programming; perhaps the hardest question is how to name these
>> "functional setters", e.g.
>>
>> person-age-set
>> set-person-age (without the !)
>> person-with-age
>> ..
>>
>>
>
> What happened to (struct-copy person p [age 25])? Or are we talking only
> about student languages and this isn't in there yet?
>
>>
>> Stephen Bloch
>> sbloch at adelphi.edu
>>
>> _________________________________________________
>>   For list-related administrative tasks:
>>   http://lists.racket-lang.org/listinfo/users
>>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.