[Nickle] Bugs with new output formatting

Barton C Massey bart at cs.pdx.edu
Wed Oct 17 16:15:53 PDT 2007

Unfortunately, the new output formatting seems to have some

  > 1/(2**64-1)

Hangs trying to output.  This used to spit something

  > 1/3

In general it appears that the curly braces are simply
omitted, without expanding the value in any reasonable way.
This seems to be the case even if "infinite precision" is
specified---I can't find any way to get the curly braces

  > printf("%.-g\n", 1/10!);

  > format = "%g";
  > format = "%f";
  Unhandled exception invalid_argument ("realformat with non-real", 1, "%f")
      raise invalid_argument ((fmts[i]).message + "format with non-" + (fmts[i]).message, 1, this_arg);
      fprintf (file, "%f")
      printf (format, v);
      display ("%f")
 <stdin>:5:     Command::display ((format = "%f"));
It's never been obvious to me why the first format command
is acceptable, but the second is not :-).

I'm not sure what to do about all this.  I think the user
should be able to select between a "%f"-like or "%g"-like
output format and the old format with the curly braces for
repeats using the format variable.  I also think that Nickle
should accept curly-repeats on the input, although I know
that's a pain in the neck.



More information about the Nickle mailing list