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

@ -444,9 +444,9 @@ func (v *StringValueStruct) Put(s string) {
export type PtrValue interface {
Kind() int;
Sub() Value;
Type() Type;
Indirect() Addr;
Sub() Value;
Get() Addr;
}
type PtrValueStruct struct {
@ -462,12 +462,12 @@ func (v *PtrValueStruct) Type() Type {
return v.typ
}
func (v *PtrValueStruct) Indirect() Addr {
func (v *PtrValueStruct) Get() Addr {
return *AddrToPtrAddr(v.addr)
}
func (v *PtrValueStruct) Sub() Value {
return NewValueAddr(v.typ.(PtrType).Sub(), v.Indirect());
return NewValueAddr(v.typ.(PtrType).Sub(), v.Get());
}
func PtrCreator(typ Type, addr Addr) Value {