[racket] Are there any functional structs in Racket

From: Everett Morse (webj2 at unoc.net)
Date: Wed Oct 20 12:58:58 EDT 2010

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
>    


Posted on the users mailing list.