// calcIdentify is a utility function to map a Calc into
// its generated type id and a pointer to the data.
calcIdentify is a utility function to map a Calc into
its generated type id and a pointer to the data.
// calcIdentify is a utility function to map a Calc into // its generated type id and a pointer to the data .
func calcIdentify(x Calc) (typeId e.TypeID, data e.Ptr) {
	switch t := x.(type) {
	case *BinaryOp:
		typeId = e.TypeID(CalcTypeBinaryOp)
		data = e.Ptr(t)
	case *Calculation:
		typeId = e.TypeID(CalcTypeCalculation)
		data = e.Ptr(t)
	case *Func:
		typeId = e.TypeID(CalcTypeFunc)
		data = e.Ptr(t)
	case *Scalar:
		typeId = e.TypeID(CalcTypeScalar)
		data = e.Ptr(t)
	default:
		panic(fmt.Sprintf("unhandled value of type: %T", x))
	}
	return
}
func calcIdentify ( x Calc ) ( typeId e . TypeID , data e . Ptr ) { switch t := x . ( type ) { case * BinaryOp : typeId = e . TypeID ( CalcTypeBinaryOp ) data = e . Ptr ( t ) case * Calculation : typeId = e . TypeID ( CalcTypeCalculation ) data = e . Ptr ( t ) case * Func : typeId = e . TypeID ( CalcTypeFunc ) data = e . Ptr ( t ) case * Scalar : typeId = e . TypeID ( CalcTypeScalar ) data = e . Ptr ( t ) default : panic ( fmt . Sprintf ( " " , x ) ) } return }
calcIdentify is a utility function to map a Calc into
its generated type id and a pointer to the data.
calcIdentify is a utility function to map a Calc into its generated type id and a pointer to the data .
// The most probable reason for this is that the generated code // is out of date, or that an implementation of the Calc // interface from another package is being passed in.