Declaration modifiers don't mention the public visibility

オープン 初心者向け
#896 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
静か
領域
documentation

調査の方向性

Manual/Defs.lean の 51 行目と 83 行目付近にある Modifiers セクションから始め、Manual/SourceFiles.lean の 348 行目付近で説明されているモジュールの動作とその文言を比較します。提供されている lake のプロジェクトコマンドとビルドコマンドを再現して、可視性の区別を確認します。Definitions 章で public visibility とモジュールとの相互作用が明確に文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

The Modifiers section of the Definitions chapter does not mention the public visibility:
https://github.com/leanprover/reference-manual/blob/986f6e92210cd96ede07c8a78317b0b998130eb2/Manual/Defs.lean#L51

Later in that section, it suggests that public is the default visibility:
https://github.com/leanprover/reference-manual/blob/986f6e92210cd96ede07c8a78317b0b998130eb2/Manual/Defs.lean#L83

That second case probably assumes outside a module, but since it already mentions modules, this is confusing. In particular after having read the previous chapter about Modules:
https://github.com/leanprover/reference-manual/blob/986f6e92210cd96ede07c8a78317b0b998130eb2/Manual/SourceFiles.lean#L348

Create a lake library project with lake new foo lib, then add module at the top of Foo/Basic.lean and def test := hello at the bottom of Foo.lean (removing comments), resulting in the following file contents:

% cat Foo.lean
import Foo.Basic
def test := hello
% cat Foo/Basic.lean 
module
def hello := "world"
% lake build
error: Foo.lean:2:12: Unknown identifier `hello`

Adding the public modifier to hello fixes the build:

% sed -i 's/^def/public def/' Foo/Basic.lean
% lake build
Build completed successfully (4 jobs).
主要言語
Lean
スター
147
フォーク
72
平均マージ
1日 17時間
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

leanprover/reference-manual のほかの issue

leanprover/reference-manual の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。