add printf to fmt.

uses reflection to determine arguments.
for now, the arguments must be provided as a struct; the compiler
will soon do the packaging automatically for "..." parameters.

R=rsc
DELTA=1436  (909 added, 520 deleted, 7 changed)
OCL=17823
CL=17831
This commit is contained in:
Rob Pike 2008-10-24 16:33:29 -07:00
parent 689b28fd96
commit 418b97c670
5 changed files with 401 additions and 8 deletions

View file

@ -151,7 +151,7 @@ func ValueToString(val Value) string {
return val.(StringValue).Get();
case PtrKind:
v := val.(PtrValue);
return TypeToString(typ, false) + "(" + integer(int64(v.Indirect())) + ")";
return TypeToString(typ, false) + "(" + integer(int64(v.Get())) + ")";
case ArrayKind:
t := typ.(ArrayType);
v := val.(ArrayValue);