Skip to content

908 Named Inline Construction ​

908-inline-construction-library-method.mc covers TYPE name(args) named inline construction with parts provided by the mcode library. Tutorial first use: 04-functions-and-reuse.

Syntax synopsis:

text
BUTTON_IN - RES R_PULL(10000R, 50V) - V3V3
bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 90-language-reference/908-inline-construction-library-method.mc --lib mcode --pass1 --pass2

Source ​

text
// Reference: Named Inline Construction
// Focus: TYPE name(args) inline construction with the mcode library parts.

module main
{
    io BUTTON_IN
    io GND
    io V3V3

    DC.SRC PWR(3.3V, 20mA)
    SWITCH.MOM SW_USER

    PWR.1 -> V3V3
    PWR.2 -> GND

    BUTTON_IN - RES R_PULL(10000R, 50V) - V3V3
    BUTTON_IN -> SW_USER.COM
    SW_USER.NO -> GND
}

MCode Bench is the public face of the MCode stack. Closed capabilities are served through the MCode gateway.