# Broken record-update behaviour in SRFI-57

**URL:** <https://racket.discourse.group/t/broken-record-update-behaviour-in-srfi-57/3613>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [March 9, 2025, 12:09pm UTC](https://racket.discourse.group/t/broken-record-update-behaviour-in-srfi-57/3613 "2025-03-09T12:09:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dguthrie](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dguthrie](https://racket.discourse.group/u/dguthrie)\
**Post date:** [March 9, 2025, 12:09pm UTC](https://racket.discourse.group/t/broken-record-update-behaviour-in-srfi-57/3613/1 "2025-03-09T12:09:03Z")

</div>

I'm trying to use SRFI 57 (the extended record types). According to the documentation, SRFI 57 is supported and indeed it appears to be built in to Racket. This is with `#lang racket` and `(require srfi/57)` as preamble.

SRFI 57 provides functional updates. The following works in the REPL (an MWE I pulled from the SRFI document proper):

```scheme
(define-record-type point (make-point x y) point?
  (x get-x set-x!)
  (y get-y set-y!))
                 
(define p (make-point 1 2))

```

Now, if I declare that **in** the REPL, I can do the following just fine:

```scheme
(record-update p point (x 7))

```

But if I define the first portion in a racket source document, use `enter!` and try my `record-update` command in the REPL on the record instance `p`, I get an error like so:

```scheme
cdr: contract violation
  expected: pair?
  given: #f
 [,bt for context]

```

What I don't understand is what the difference could possibly be. It seems like a bug to me. `point?` holds for this `p` object in the REPL, so it isn't like how struct types when redefined don't refer to the same object as older objects defined as one.
