racket / racket/drracket

disappearing syntax properties in DrRacket 7.0.0.7 REPL

Open
#224 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

Consider this language that accepts one expression:

;; lang.rkt
#lang racket
(provide (except-out (all-from-out racket) #%module-begin)
         (rename-out [mb #%module-begin]))

(define-syntax (mb stx)
  (syntax-case stx ()
    [(_ EXPR)
     (with-syntax ([PEXPR (syntax-property #'EXPR 'foo "bar")])
       #`(#%module-begin #'PEXPR #,(syntax-property #'PEXPR 'foo)))]))

(module reader syntax/module-reader
  "lang.rkt")

And a file that invokes it:

;; langtest.rkt
#lang reader (submod "lang.rkt" reader)
"string"

When I run langtest.rkt the first time, a syntax object is printed to the REPL with an info box like so, followed by the value of the foo property:

screen shot 2018-07-23 at jul 23 1 49 48 pm

But when I run langtest.rkt again, the Original? property changes to #f , and the custom foo property disappears from the info box, though it still prints to the REPL:

screen shot 2018-07-23 at jul 23 1 49 56 pm

This seems wrong.

After that, I can only get the correct (initial) info box to show up again if I quit and restart DrRacket. (In particular, changing the #lang line, or using Reload #lang extensions, has no effect.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the lang.rkt and langtest.rkt examples in DrRacket, running langtest.rkt twice and observing the syntax object's info box. Trace where the REPL or editor retains syntax properties between runs. Done means the custom foo property and Original? state remain correct without restarting DrRacket.

Written by the indexing model from the issue text.

Assessment

Domain
desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.