[racket] Are there any functional structs in Racket

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Wed Oct 20 11:05:05 EDT 2010

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
..



Stephen Bloch
sbloch at adelphi.edu



Posted on the users mailing list.