Coming off Sven's posting at
http://lists.wfu.edu/pipermail/gretl-devel/2016-September/006903.html
I'd like to show a couple of real-world examples of alternatives to
"good old" printf in the econometrics domain.
I'd be interested to hear what people think of the comparison. If
lots of people tell me they still think printf sucks, than I guess
I'll have to rethink.
<hansl>
set echo off
set messages off
# hansl, using printf
h = 8
w = 6
printf "Henry the %gth had %g wives\n", h, w
vname = "dispinc"
b = 0.9307
se = 0.0421
printf "The coefficient on %s is %g, with std error %g\n",
vname, b, se
foreign language=R
h <- 8
w <- 6
cat(paste("Henry the", h, "th had", w, "wives\n"))
vname <- "dispinc"
b <- 0.9307
se <- 0.0421
cat(paste("The coefficient on", vname, "is", b, ", with std
error",
se, "\n"))
end foreign
foreign language=Ox
#include <oxstd.h>
main() {
decl h = 8;
decl w = 6;
print("Henry the ", h, "th had ", w, " wives\n");
decl vname = "dispinc";
decl b = 0.9307;
decl se = 0.0421;
print("The coefficient on ", vname, " is ", b, " with std
error ",
se, "\n");
}
end foreign
</hansl>
Allin