mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
689b28fd96
commit
418b97c670
5 changed files with 401 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue