Am 21.09.2016 um 07:31 schrieb Riccardo (Jack) Lucchetti:
On Tue, 20 Sep 2016, Allin Cottrell wrote:
> That said, I can see a case for making it easier to output very
simple
> stuff such as a string followed by a scalar on the same line.
Yes, I was especially fascinated by Lee's Stata example:
di "The sample size is " e(N)
I'm ready to surrender and declare defeat, but not without a final note
that I find it sad that this level of simplicity shouldn't be possible
in hansl...
> answer = 42
> print "The number of roads a man must walk down is " -n
> eval answer
...
> I don't know if anyone will consider this worthwhile.
I, for one, do not.
Here I agree with Jack, this doesn't really cut it. However, it prompted
me to try this, which also produced a single-line output:
<hansl>
set echo off
printf "heyhey: "
eval 3/2
</hansl>
After having heard several opinions (thanks to everybody who joined the
debate) I suggest to leave everything as is now. The recent improvements
in the documentation should also help.
What I learned from the discussion is that I still think hansl could use
a syntactic-sugar/one-argument version of sprintf() such that sprintf(x)
== sprintf("%g", x), when x is a scalar type. (Could also have a new
alias name instead of 'sprintf' then, but that's not my point.)
thanks,
sven