code: func (a *expr) genConstant(v Value) {
  	switch a.t.lit().(type) {
  	case *boolType:
  		a.eval = func(t *Thread) bool { return v.(BoolValue).Get(t) }
  	case *uintType:
  		a.eval = func(t *Thread) uint64 { return v.(UintValue).Get(t) }
  	case *intType:
  		a.eval = func(t *Thread) int64 { return v.(IntValue).Get(t) }
  	case *idealIntType:
  		val := v.(IdealIntValue).Get()
  		a.eval = func() *big.Int { return val }
  	case *floatType:
  		a.eval = func(t *Thread) float64 { return v.(FloatValue).Get(t) }
  	case *idealFloatType:
  		val := v.(IdealFloatValue).Get()
  		a.eval = func() *big.Rat { return val }
  	case *stringType:
  		a.eval = func(t *Thread) string { return v.(StringValue).Get(t) }
  	case *ArrayType:
  		a.eval = func(t *Thread) ArrayValue { return v.(ArrayValue).Get(t) }
  	case *StructType:
  		a.eval = func(t *Thread) StructValue { return v.(StructValue).Get(t) }
  	case *PtrType:
  		a.eval = func(t *Thread) Value { return v.(PtrValue).Get(t) }
  	case *FuncType:
  		a.eval = func(t *Thread) Func { return v.(FuncValue).Get(t) }
  	case *SliceType:
  		a.eval = func(t *Thread) Slice { return v.(SliceValue).Get(t) }
  	case *MapType:
  		a.eval = func(t *Thread) Map { return v.(MapValue).Get(t) }
  	default:
  		log.Panicf("unexpected constant type %v at %v", a.t, a.pos)
  	}
  }
docs: /*
   * Operator generators.
   */