• Rob Pike's avatar
    printf as we know and love it. · 2d4f7ba0
    Rob Pike authored
    Plus print[ln] with the ability to print struct values.
    
    Note for language mavens: if a "..." function passes its argument
    to another "..." function, the argument is not wrapped again.  This
    allows printf to call fprintf without extra manipulation. It's good
    but needs to go in the spec.
    
    This code works:
    ///
    package main
    
    import fmt "fmt"
    import os "os"
    
    type T struct { s string; a, b int }
    
    func main() {
    	P := fmt.Printer();
    	P.printf("%s = %d with float value %.4f\n", "hi there", 7, 123.456);
    	P.println("hi there", 7, 123.456);
    	P.fprintf(os.Stdout, "%s = %d with float value %.4f\n", "hi there", 7, 123.456);
    	P.println(T{"x", 7, 234}, "end of struct", 8, 9);
    }
    
    R=rsc
    DELTA=28  (7 added, 3 deleted, 18 changed)
    OCL=18321
    CL=18324
    2d4f7ba0
Name
Last commit
Last update
..
container Loading commit data...
fmt Loading commit data...
http Loading commit data...
math Loading commit data...
net Loading commit data...
os Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
syscall Loading commit data...
time Loading commit data...
bufio.go Loading commit data...
clean.bash Loading commit data...
flag.go Loading commit data...
io.go Loading commit data...
make.bash Loading commit data...
once.go Loading commit data...
rand.go Loading commit data...
sort.go Loading commit data...
strings.go Loading commit data...