racket / racket/drracket

check-syntax: no arrow for sub-range-binders when the bound occurrence is inside syntax

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

Nobody has claimed this yet.

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

Description

Consider:

#lang racket

(define-syntax (m stx)
  (syntax-case stx ()
    [(_ id1)
     (identifier? #'id1)
     (syntax-property
      #'1
      'disappeared-binding (list (syntax-local-introduce #'id1)))]))
 
(m a)

(syntax a)

Check Syntax is able to draw an arrow from a in m to a in syntax correctly.

Now, consider:

#lang racket

(define-syntax (define* stx)
  (syntax-case stx ()
    [(_ id1)
     (let ()
       (define first-part (symbol->string (syntax-e #'id1)))
       (define first-len (string-length first-part))
       (define new-id
         (datum->syntax
          #'id1
          (string->symbol (string-append first-part "*"))))
       (syntax-property
        #`(define #,new-id 1)
        'sub-range-binders
        (list
         (vector (syntax-local-introduce new-id)
                 0 first-len 0.5 0.5
                 (syntax-local-introduce #'id1)
                 0 first-len 0.5 0.5))))]))
 
(define* big)
(syntax big*)
big*

While Check Syntax is able to draw an arrow from big to the second big*, it is unable to draw an arrow to the first big*, which is inside syntax.

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

Start by tracing Check Syntax's handling of sub-range-binders when a bound occurrence is inside syntax. Use the two reproductions in the issue to compare the arrows from big to each big* occurrence. Done means both arrows are drawn correctly, including the occurrence inside syntax.

Written by the indexing model from the issue text.

Assessment

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