racket / racket/scribble

In source strcut*-doc does not convert to defstruct* properly when #:constructor-name is used

Open Beginner friendly
#500 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
250
Forks
102
Avg merge
11d 11h
Merged PRs (30d)
1

Description

struct*-doc in scribble/srcdoc converts to defstruct*. There is a problem in how the arguments are converted when #:constructor-n
name is provided.

If you run the following code

#lang racket/base

(require  scribble/srcdoc)

(struct point (x y) #:constructor-name make-point)

(provide
 (struct*-doc
  point
  ([x integer?] [y integer?])
  #:constructor-name make-point
  ("Creates a point structure")
  ))

You get the error

/scribble-lib/scribble/srcdoc.rkt:564:10: defstruct*: expected expression
at: #:constructor-name
in: (defstruct* point ((x integer?) (y integer?)) make-point #:constructor-name "Creates a lala structure")

You can see the order of #:constructor-name and make-point is inverted when it tries to convert

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 in scribble/srcdoc.rkt around line 564 and inspect how struct*-doc converts its arguments to defstruct*. Run the reproduction from the issue, focusing on the #:constructor-name and make-point ordering. Done means the provided example converts successfully without the defstruct* expected-expression error.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.