Scribble examples fail to use `+` correctly
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
調査の方向性
Reproduce the Scribble example with scribble/examples and the demo macro, then inspect scribble-lib/scribble/racket.rkt around line 1272 and its use of syntax-span. Compare the quoted and syntax-quoted #%provide forms and determine why the composition produces #f; done means the reported example no longer raises the + contract violation.
索引モデルが issue の本文から書いたものです。
説明
I'm on 8.10 [cs], the latest Debian, and am running my code using racket-mode. I have a #lang scribble/manual document that depends on scribble/examples. I'll start with the error.
; +: contract violation
; expected: number?
; given: #f
; Context (plain; to see better errortrace context, re-run with C-u prefix):
; /home/sage/.racket/share/pkgs/scribble-lib/scribble/racket.rkt:1272:26 loop
; /home/sage/.racket/share/pkgs/scribble-lib/scribble/racket.rkt:1272:26 loop
; /home/sage/.racket/share/pkgs/scribble-lib/scribble/racket.rkt:1168:0 do-syntax-ize
; /home/sage/.racket/share/pkgs/scribble-lib/scribble/racket.rkt:1272:26 loop
; /home/sage/.racket/share/pkgs/scribble-lib/scribble/racket.rkt:1272:26 loop
[...]
This @-expression from my code that raises the error. Simpler examples do not reproduce, so let's go with this for now. It appears that the (struct term:ksub term (body) #:transparent) instance fails in this exact composition, where term is just (struct term () #:transparent). I'm omitting other structure definitions to keep this at least somewhat brief.
@demo[
(define (ksub-example . xs)
(with-syntax ([(x ...) xs])
(term:ksub-parse
#'(module #%kernel '#%kernel
(#%module-begin
(#%require '#%kernel
(for-syntax '#%kernel)
(prefix : '#%kernel)
(for-syntax (prefix : '#%kernel)))
x ...)))))
(ksub-example '(#%provide (all-from '#%kernel)))
]
I use this demo macro. Let #:eval be hypothetical.
(define-syntax-rule (demo forms ...)
(examples #:eval (example-evaluator) forms ...))
If you change '(#%provide (all-from '#%kernel))) to #'(#%provide (all-from '#%kernel))), the error goes away. Since scribble-lib/scribble/racket.rkt:1272:26 makes heavy use of syntax-span, I suspect that location information disappears in some nontrivial compositions of quoted code in syntax templates.
- 主要言語
- Racket
- スター
- 251
- フォーク
- 101
- 平均マージ
- 6日 22時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
racket/scribble のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
racket/scribble の issue をすべて見る
似ている issue
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
glossyio/traffic-monitor#244 ·
メンテナーはふだん 1 日以内に返信