/// <summary>
        /// If the given input port has a connection, compile and return the connection's
        /// output variable name. If not, return a constant representing the default (inline) value.
        /// </summary>
        private string ConstantOrVariable <T>(CodeBuilder builder, string portName, T defaultValue = default)
        {
            Port port = GetPort(portName);

            return(builder.PortToValue(port, defaultValue).ToString());
        }