Expand description
Placed parts: the part another program builds, placed in a part as a
node of its own (placed), whose value is the built part
(PlacedPart), made by build_placed.
A placed part is built from exactly its program, its inputs and the
slice of the placing part’s state under its name — the state
/bolt:b.pose of the part is the state b.pose of the part placed as
bolt (key_behind). Equal builds are shared through the runner’s build cache: a
thousand screws of one size are one build. Where the part goes is no
concern of the build: the pose that places it is the placing part’s
state, read by whatever draws or mates it.
An element of a placed part is named by the instance’s path before its
target’s name — /bolt:model, or /asm/bolt:model for a part placed in
a placed part, and /:model for one of the part itself (Located) —
and read through the placing
part’s reader (crate::reader::Reader::retrieve_placed,
crate::reader::Reader::placed_part), which records it as read inside
the placed part: a node reading the second link of an arm is made again
when that link changes, not when anything in the arm does.
A part placed reads the part placing it in context, while it is built
there, through the path OUTSIDE: /../bracket:model is the model
of the part placed as bracket beside it — placed before it, so that no
two parts read each other — and /..:model the placing part’s own (see
crate::reader::Reader::outside). What it read so is read by the
placing part for it, so a change there builds it again, and a build of
it is shared only where what it read there reads the same.
Structs§
- InInstance
- An element of a part or of a part placed in it, as it is in its own
part (
Reader::retrieve_placed): where that part is placed, the step that placed it says. - Located
- A name behind the path of the instance it is in: a target of a part
placed in the part — however deep — or of the part itself, its path
empty. Spelled
/asm/bolt:model, and/:modelfor the part itself (Located::parse, itsDisplay), and saved and sent to a front end so. - Placed
Args - What a part is placed from: the program file, as the placing program names it, what its parameters are set to, and the steps run after its own — none, for the part as its file builds it: a part derived from it, mirrored, say, otherwise.
- Placed
Part - A placed part, as built: shared by every instance built alike — and where its program is, which an editor edits it in.
Constants§
- INSTANCE_
SEPARATOR - What separates the names of a path of instances, and begins a located
name:
/asm/bolt:model. - OUTSIDE
- The name of the part a part is placed in, in a path of instances: the
part placing it, read in context —
/../bracket:model. - TARGET_
SEPARATOR - What separates a located name’s instance path from the name in that
instance:
/asm/bolt:model. A name is split at the first one after the path, so the name itself may hold more:/asm:placed:bolt.
Functions§
- build_
derived - The part the program
argsplaces builds on its own — with its own state, placed nowhere: what a step deriving a part from another reads the bodies of. Shared with every build alike, a placed one’s too. Records the file and every file the part read. - build_
placed - The make of a placed part (see
place): the program in the fileargs.filenames, run withargs.inputsand the state the placing part gives under the instance’s name, the program’s own where it gives none. Taken from the runner’s build cache where an equal build is there; else built from the part the instance had before, if it had one, so that only what reads what changed is made again — placed in the partreaderreads, which it reads in context. Records the file and every state and file the part placed read, and what it read in context. - instance_
path - The path of the instance
nameof the instance atouter:asm/bolt—nameitself, for none. A path is held without the leadingINSTANCE_SEPARATORits located names are spelled with. Anamethrough the partouteris placed in (OUTSIDE) goes up out of it:../bracketofasm/pisasm/bracket. - key_
behind - The key
keyof the part placed asinstance— its own,b.pose, or one of a part placed in it,/bolt:b.pose— as a key of the part it is placed in:/asm:b.pose,/asm/bolt:b.pose(seeLocated::key). - key_
inside - The key of the part placed as
instancethatkey, a key of the part it is placed in, is, if it is one of that part:key_behindundone. - outermost_
instance - The outermost instance a key of a part’s own table is of, and the key as that instance’s part names it: none for a key of the part’s own.
- place
- Places the part the program in
args.filebuilds asinstance, its parameters set toargs.inputs(build_placed). Fails if a step of the part placed fails — after placing it as far as it builds. - placed
- The target of the part placed as
instance. - split_
instance_ path - The path of the instance the instance at
pathis placed in, and its name there:("asm", "bolt")forasm/bolt, an empty path for an instance of the part itself —instance_pathundone.