Gene Pasquet on Nostr: Is there a way with #guile #scheme to create a new record from an existing one and ...
Is there a way with #guile #scheme to create a new record from an existing one and only change a few properties? Something like:
```
(define-record-type <snake>
(make-snake gender length color)
snake?
(gender snake-gender)
(length snake-length)
(color snake-color))
(define a (make-snake 'female 100 'brown))
(define b (derive a :length 50 :color 'green)) ; <= this here
```
#guilescheme
```
(define-record-type <snake>
(make-snake gender length color)
snake?
(gender snake-gender)
(length snake-length)
(color snake-color))
(define a (make-snake 'female 100 'brown))
(define b (derive a :length 50 :color 'green)) ; <= this here
```
#guilescheme