Skip to content

Commit

Permalink
Add: KIND を
Browse files Browse the repository at this point in the history
値を抽象化するため。
  • Loading branch information
Hexirp committed Sep 5, 2021
1 parent 180e9f8 commit a9f368f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion intheo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub const CON : Slot = Slot { id : 1 };
/// `10` である。
pub const FAN : Slot = Slot { id : 2 };

/// `11` である。
pub const KIND : Slot = Slot { id : 3 };

/// `Port` である。 `Address` と `Slot` のペアである。
#[derive(Clone, Debug)]
pub struct Port { pub id : u32 }
Expand Down Expand Up @@ -69,7 +72,7 @@ pub fn enter(net : Net, port : Port) -> Port
/// `Address` の `Slot` を返す。
pub fn kind(net : Net, address : Address) -> Slot
{
slot(vector::get(& net.nodes, port(address, Slot { id : 3 }).id as usize).clone())
slot(vector::get(& net.nodes, port(address, KIND).id as usize).clone())
}

/// 2 つの `Port` を繋ぐ。
Expand Down

0 comments on commit a9f368f

Please sign in to comment.