I prefer the Ox print() function, but printf would need to stick around for backward compatibility. Moreover, it seems formatting using the Ox print() syntax would be more complicated
than printf. Thus, I am not sure it makes enough difference to warrant the extra work.
Logan
From: gretl-devel-bounces@lists.wfu.edu [mailto:gretl-devel-bounces@lists.wfu.edu]
On Behalf Of Lee Adkins
Sent: Monday, September 19, 2016 4:46 PM
To: Gretl development <gretl-devel@lists.wfu.edu>
Subject: Re: [Gretl-devel] printf poll?
I'll take the gretl version as well.
Lee
On Mon, Sep 19, 2016 at 4:12 PM, Allin Cottrell <cottrell@wfu.edu> wrote:
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
_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel
--
Lee Adkins
Professor of Economics and Department Head
Economics and Legal Studies in Business
Oklahoma State University
Email: lee.adkins@okstate.edu
Fax: 405-744-5180
Phone: 405-744-5196