[Nickle]
Various nits/bugs/defects (Re: [Commit] nickle printf.5c,1.5,1.6)
Bart Massey
bart at cs.pdx.edu
Tue Jun 17 00:20:57 PDT 2003
When did you add that beauty? Frightening, but harmless, I
guess. At any rate, for those of us who are not aware of
the undocumented intricacies of Nickle, vprintf() is nice to
have around also :-). After all, I note that you now could
also remove vfprintf() and basically all the v*() functions.
> string sprintf(string format, poly args ...) {
+ file f = File::string_write ();
+ fprintf(f, format, args ...);
+ return File::string_string (f);
+ }
> sprintf("%s", "hello")
"hello"
>
I'd advise leaving them in as a convenience
BTW, I was in lexer hell trying to debug just now:
1. I am *really* used to the convention of Lisp, Scheme, and
ML debuggers that pop a level of debugger on EOF. Having
Nickle suddenly and irrevocably exit is really painful
for those of us used to that. It is not helpful that
saying "exit" instead simply prints the definition of the
exit() function, and saying "h" or "?" gives an error.
"done" is really hard for me to remember. How much of
this is fixable?
2. We *really* have to fix the extra-semicolons-prompted-
for-at-top-level-for-no-reason-obvious-to-most-users bug.
I understand why it is hard, but it's pretty unlivable as
it is. We've kicked around a million options, and I'm
not sure what to do at this point. There is some
low-hanging fruit: since definition expressions are now
values, shouldn't int[*] a = {1, 2, 3} at top level print
the value of a?
I'm tempted to say that anytime a statement *could*
terminate at EOL it should: one can backslash to continue
the statement. This amounts to resolving shift/reduce
conflicts the other way at top level, I guess: is there a
way to stick an action in just the right spot to make
this happen?
Finally, it appears that the syntax that is printed out for
int array values, e.g.
[3] {1, 2, 3}
for the above, is no longer accepted by the reader. Not
good. Probably just want to fix the value printer.
Bart
In message <E19S85J-0002kt-00 at localhost> you wrote:
>
> You never need vprintf; you can just use printf:
>
> printf ("%d %d %d\n", (int[3]) { 1, 2, 3} ... )
>
> -keith
More information about the Nickle
mailing list