src/doctor/world.bend checks
raw source on the hub · import 0x74799d3f846634a3d7461d4336d7c9d4/src/doctor/world.bend as World
doctor/world: what ez doctor reads. The C compiler $CC names ("" when
it is unset) and $BEND_LIB ("" when it is unset), which the planner
(doctor/plan.bend) turns into the compiler and the library it reports on;
the ledger's text and the lock's text, None when there is no file; and the
answers to the questions the planner asked. There is no field for the
clock or the rest of the environment, because the planner reads neither.
A question is a program asked for its version, the names of the packages
under BEND_LIB, the project's sources, or a package's tree under BEND_LIB.
The sources are every .bend file git tracks, with its text, which is the
lock's own listing (W.Listing), read the way ez lock reads it. So doctor
judges the import lines ez lock judges. A tree is asked about with the
lock's own question (W.Ask) and answered only from BEND_LIB: the manifest
there and the text of each file it names, or that there is none. Doctor
never asks the network, so this is all it can know of a package. A name the
lock records is asked about as the file bend reads its hash from,
$BEND_LIB/names/<nv>, as it is.
3 imports
import Base import ../lock/world.bend as W import ../ledger/manifest.bend as M
Types
type Ask source · line 23 · raw
Data
a question the planner asks
Probe@name:String -> Ask
Lib@dir:String -> Ask
SourcesAsk
Tree@ask:0x74799d3f846634a3d7461d4336d7c9d4/src/lock/world.Ask -> Ask
Name@nv:String -> Ask
type Answer source · line 33 · raw
Data
the answer to one: what a program printed, and whether it ran; or the sources as the lock lists them; or a package's tree as BEND_LIB holds it, or that BEND_LIB holds none
Printed@ok:Bool -> @text:String -> Answer
Listed@listing:0x74799d3f846634a3d7461d4336d7c9d4/src/lock/world.Listing -> Answer
Laid@manifest:String -> @srcs:List<&2, String> -> Answer
AwayAnswer
Held@got:Maybe<&2, String> -> Answer
type Reply source · line 41 · raw
Data
one question, answered
Reply@ask:Ask -> @answer:Answer -> Reply
type World source · line 45 · raw
Data
everything ez doctor reads
World@cc:String -> @lib:String -> @ledger:Maybe<&2, String> -> @lock:Maybe<&2, String> -> @replies:List<&2, Reply> -> World
type Heard source · line 111 · raw
Data
an answer looked up, or none yet
Heard@answer:Answer -> Heard
OpenHeard
Definitions
def toml source · line 50 · raw
String
the ledger's path, which is fixed
def lockfile source · line 54 · raw
String
the lock's path, which is fixed
def cc source · line 58 · raw
@world:World -> String
what $CC holds, "" when it is unset
def lib source · line 63 · raw
@world:World -> String
what $BEND_LIB holds, "" when it is unset
def ledger source · line 68 · raw
@world:World -> Maybe<&2, String>
the ledger's text, None when there is no ez.toml
def lock source · line 73 · raw
@world:World -> Maybe<&2, String>
the lock's text, None when there is no ez.lock.toml
def replies source · line 78 · raw
@world:World -> List<&2, Reply>
every question answered so far
def read.of source · line 84 · raw
@got:Maybe<&2, String> -> 0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Read
the ledger as read: what the file says, or, with no file, a read that did not parse and says why, as every command that reads a ledger says it
def read source · line 92 · raw
@world:World -> 0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Read
the ledger, read
def key source · line 97 · raw
@ask:Ask -> String
a question as a key. A program's name and a directory hold no newline, so the fields are kept apart by one.
def look.step source · line 117 · raw
@hit:Bool -> @answer:Answer -> @rest:(@_:Unit -> Heard) -> Heard
this answer when it is the question's, otherwise the rest's. The rest arrives as a thunk, so the first hit ends the scan.
def look source · line 125 · raw
@rs:List<&2, Reply> -> @+want:String -> Heard
the first answer given to a question
def heard source · line 133 · raw
@rs:List<&2, Reply> -> @ask:Ask -> Heard
the answer to a question, or none yet
def sources source · line 137 · raw
@world:World -> Heard
the answer the sources question has had on a World, or none yet