* *s ignored on windows gui @ 2004-10-26 12:20 Tiago Dionizio 2004-10-26 15:49 ` [Caml-list] " Alex Baretta 0 siblings, 1 reply; 8+ messages in thread From: Tiago Dionizio @ 2004-10-26 12:20 UTC (permalink / raw) To: Caml Mailing List Hi, i was playing with ocaml (learning!) and bumped with something that i think it might be a bug... since i didn't find anything explaining this behaviour: Objective Caml version 3.08.0 # print_string "**e";; e- : unit = () # print_char '*';; - : unit = () # it seems that the '*' char is ignored at the beginning of the lines on the windows gui, the same does -not- happen on the command line version. Is this a known problem? Sorry if this was reported already or if it a known issue. Tiago ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-26 12:20 *s ignored on windows gui Tiago Dionizio @ 2004-10-26 15:49 ` Alex Baretta 2004-10-26 16:06 ` David Brown 0 siblings, 1 reply; 8+ messages in thread From: Alex Baretta @ 2004-10-26 15:49 UTC (permalink / raw) To: Tiago Dionizio; +Cc: Caml Mailing List Tiago Dionizio wrote: > Hi, > > i was playing with ocaml (learning!) and bumped with something that i > think it might be a bug... since i didn't find anything explaining > this behaviour: > > Objective Caml version 3.08.0 > > # print_string "**e";; > e- : unit = () > # print_char '*';; > - : unit = () > # Try flushing stdout. Alex ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-26 15:49 ` [Caml-list] " Alex Baretta @ 2004-10-26 16:06 ` David Brown [not found] ` <c5a3ec0104102610237b92dcaa@mail.gmail.com> 0 siblings, 1 reply; 8+ messages in thread From: David Brown @ 2004-10-26 16:06 UTC (permalink / raw) To: Alex Baretta; +Cc: Tiago Dionizio, Caml Mailing List On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > ># print_string "**e";; > >e- : unit = () > > Try flushing stdout. I don't think it will help, since the 'e' is getting printed, just not the '*'s before it. I don't see anything in the source that looks like it would cause this problem, but there might be something subtle. Did it happen with 3.07? The windows code changed quite a bit between. Dave ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <c5a3ec0104102610237b92dcaa@mail.gmail.com>]
* Re: [Caml-list] *s ignored on windows gui [not found] ` <c5a3ec0104102610237b92dcaa@mail.gmail.com> @ 2004-10-26 21:38 ` Tiago Dionizio 2004-10-27 0:30 ` Christopher A. Watford 0 siblings, 1 reply; 8+ messages in thread From: Tiago Dionizio @ 2004-10-26 21:38 UTC (permalink / raw) To: Caml Mailing List I didn't try with 3.07, only started working with OCaml recently. Although this is a very rough attempt on locating the problem, this might have something to do with it: on file win32caml/ocaml.c around the line 1319 here is what i found: ... case WM_TIMERTICK: /** Modified by Chris Watford 21 Sept 2003 **/ hwndChild = (HWND) GetWindowLong(hwnd, DWL_USER); if (ReadToLineBuffer()) { int errMsg = 0; char *p, *l = lineBuffer; // Ok we read something. Display the trimmed version while(((*l) == ' ') || ((*l) == '\t') || ((*l) == '\n') || ((*l) == '\r') || ((*l) == '*')) l++; ... I have no idea why it trims empty spaces and the *'s. There may be a good reason for this to happen.. but i did get very confused when this happened to me the first time. Tiago On Tue, 26 Oct 2004 09:06:01 -0700, David Brown <caml-list@davidb.org> wrote: > On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > > > ># print_string "**e";; > > >e- : unit = () > > > > Try flushing stdout. > > I don't think it will help, since the 'e' is getting printed, just not the > '*'s before it. I don't see anything in the source that looks like it > would cause this problem, but there might be something subtle. Did it > happen with 3.07? The windows code changed quite a bit between. > > Dave > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-26 21:38 ` Tiago Dionizio @ 2004-10-27 0:30 ` Christopher A. Watford 2004-10-27 2:21 ` Christopher A. Watford 0 siblings, 1 reply; 8+ messages in thread From: Christopher A. Watford @ 2004-10-27 0:30 UTC (permalink / raw) To: Tiago Dionizio; +Cc: Caml Mailing List Ok let me explain why I trim these. What happens when some luser forgets to terminate a comment, a string, etc, the damn redirected shell process puts out either ' *' at the front of a line, or just extra spaces. The actual variables etc aren't being trimmed, just the output. I'll try and work around having to trim those with some more intelligent checks for user input failures. Thanks for pointing out that bug! Keep them coming! Chris On Tue, 26 Oct 2004 21:38:02 +0000, Tiago Dionizio <tngd81@gmail.com> wrote: > I didn't try with 3.07, only started working with OCaml recently. > > Although this is a very rough attempt on locating the problem, this > might have something to do with it: > > on file win32caml/ocaml.c around the line 1319 here is what i found: > > ... > case WM_TIMERTICK: > /** Modified by Chris Watford 21 Sept 2003 **/ > hwndChild = (HWND) GetWindowLong(hwnd, DWL_USER); > > if (ReadToLineBuffer()) > { > int errMsg = 0; > char *p, *l = lineBuffer; > > // Ok we read something. Display the > trimmed version > while(((*l) == ' ') || ((*l) == '\t') > || ((*l) == '\n') || ((*l) == '\r') || ((*l) == '*')) > l++; > ... > > I have no idea why it trims empty spaces and the *'s. There may be a > good reason for this to happen.. but i did get very confused when this > happened to me the first time. > > Tiago > > > > > On Tue, 26 Oct 2004 09:06:01 -0700, David Brown <caml-list@davidb.org> wrote: > > On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > > > > > ># print_string "**e";; > > > >e- : unit = () > > > > > > Try flushing stdout. > > > > I don't think it will help, since the 'e' is getting printed, just not the > > '*'s before it. I don't see anything in the source that looks like it > > would cause this problem, but there might be something subtle. Did it > > happen with 3.07? The windows code changed quite a bit between. > > > > Dave > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Christopher A. Watford christopher.watford@gmail.com http://dorm.tunkeymicket.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-27 0:30 ` Christopher A. Watford @ 2004-10-27 2:21 ` Christopher A. Watford 2004-10-27 3:12 ` Christopher A. Watford 0 siblings, 1 reply; 8+ messages in thread From: Christopher A. Watford @ 2004-10-27 2:21 UTC (permalink / raw) To: Caml Mailing List; +Cc: Tiago Dionizio Here is some output from my recently applied changes: # print_string "**e";; **e- : unit = () # print_char '*';; *- : unit = () # print_char '\t';; - : unit = () # print_char '*';; *- : unit = () # Note the crappy leading space if you use lots of lines.... I'm not sure how I should go about checking for things like that. The old code removed all whilespace leading the output (and those *'s, hehe sorry). Is the desired functionality leaving the output intact? If so the above looks like this: # print_string "**e";; **e- : unit = () # print_char '*';; *- : unit = () # print_char '\t';; - : unit = () # print_char '*';; *- : unit = () # With only a bunch of leading white space when you use more than 1 line. Should I have it detect and remove 1 space for each extra line? The reality of what goes on is accurately shown below: # print_char '*';; *- : unit = () # Note I used no indentation between lines, and no indentation appeared in my output. I think it would require a bit of extra work, but I might could finagle keeping track of indentation for removal in the output. On Tue, 26 Oct 2004 20:30:28 -0400, Christopher A. Watford <christopher.watford@gmail.com> wrote: > Ok let me explain why I trim these. > > What happens when some luser forgets to terminate a comment, a string, > etc, the damn redirected shell process puts out either ' *' at the > front of a line, or just extra spaces. The actual variables etc aren't > being trimmed, just the output. > > I'll try and work around having to trim those with some more > intelligent checks for user input failures. > > Thanks for pointing out that bug! Keep them coming! > > Chris > > > > On Tue, 26 Oct 2004 21:38:02 +0000, Tiago Dionizio <tngd81@gmail.com> wrote: > > I didn't try with 3.07, only started working with OCaml recently. > > > > Although this is a very rough attempt on locating the problem, this > > might have something to do with it: > > > > on file win32caml/ocaml.c around the line 1319 here is what i found: > > > > ... > > case WM_TIMERTICK: > > /** Modified by Chris Watford 21 Sept 2003 **/ > > hwndChild = (HWND) GetWindowLong(hwnd, DWL_USER); > > > > if (ReadToLineBuffer()) > > { > > int errMsg = 0; > > char *p, *l = lineBuffer; > > > > // Ok we read something. Display the > > trimmed version > > while(((*l) == ' ') || ((*l) == '\t') > > || ((*l) == '\n') || ((*l) == '\r') || ((*l) == '*')) > > l++; > > ... > > > > I have no idea why it trims empty spaces and the *'s. There may be a > > good reason for this to happen.. but i did get very confused when this > > happened to me the first time. > > > > Tiago > > > > > > > > > > On Tue, 26 Oct 2004 09:06:01 -0700, David Brown <caml-list@davidb.org> wrote: > > > On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > > > > > > > ># print_string "**e";; > > > > >e- : unit = () > > > > > > > > Try flushing stdout. > > > > > > I don't think it will help, since the 'e' is getting printed, just not the > > > '*'s before it. I don't see anything in the source that looks like it > > > would cause this problem, but there might be something subtle. Did it > > > happen with 3.07? The windows code changed quite a bit between. > > > > > > Dave > > > > > > > _______________________________________________ > > Caml-list mailing list. Subscription management: > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > > Archives: http://caml.inria.fr > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > -- > Christopher A. Watford > christopher.watford@gmail.com > http://dorm.tunkeymicket.com > -- Christopher A. Watford christopher.watford@gmail.com http://dorm.tunkeymicket.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-27 2:21 ` Christopher A. Watford @ 2004-10-27 3:12 ` Christopher A. Watford 2004-10-27 11:34 ` Tiago Dionizio 0 siblings, 1 reply; 8+ messages in thread From: Christopher A. Watford @ 2004-10-27 3:12 UTC (permalink / raw) To: Caml Mailing List; +Cc: Tiago Dionizio # print_char '*';; *- : unit = () # print_string " 3 spaces";; _-_3 spaces- : unit = () # I turned the spaces in the last example into an alternating pattern so you could see nothing got trimmed! I'll get this code into CVS. As always, if you want the bleeding edge of OCamlWinPlus, I suggest you check out (that is my actual VS.Net project directory): http://projects.tunkeymicket.com/OCamlWinPlus/Release/ If you'd like the more stable side of the bleeding edge (stable directory on my webserver that only takes polished copies): http://dorm.tunkeymicket.com/OCamlWinPlus/Release/ Hope that helps! Chris On Tue, 26 Oct 2004 22:21:56 -0400, Christopher A. Watford <christopher.watford@gmail.com> wrote: > Here is some output from my recently applied changes: > > # print_string "**e";; > **e- : unit = () > # print_char '*';; > *- : unit = () > # print_char '\t';; > - : unit = () > # > > print_char '*';; > *- : unit = () > # > > Note the crappy leading space if you use lots of lines.... I'm not > sure how I should go about checking for things like that. The old code > removed all whilespace leading the output (and those *'s, hehe sorry). > > Is the desired functionality leaving the output intact? If so the > above looks like this: > > # print_string "**e";; > **e- : unit = () > # print_char '*';; > *- : unit = () > # print_char '\t';; > - : unit = () > # > > print_char '*';; > *- : unit = () > # > > With only a bunch of leading white space when you use more than 1 > line. Should I have it detect and remove 1 space for each extra line? > The reality of what goes on is accurately shown below: > > # > > print_char '*';; > *- : unit = () > # > > Note I used no indentation between lines, and no indentation appeared > in my output. I think it would require a bit of extra work, but I > might could finagle keeping track of indentation for removal in the > output. > > > > On Tue, 26 Oct 2004 20:30:28 -0400, Christopher A. Watford > <christopher.watford@gmail.com> wrote: > > Ok let me explain why I trim these. > > > > What happens when some luser forgets to terminate a comment, a string, > > etc, the damn redirected shell process puts out either ' *' at the > > front of a line, or just extra spaces. The actual variables etc aren't > > being trimmed, just the output. > > > > I'll try and work around having to trim those with some more > > intelligent checks for user input failures. > > > > Thanks for pointing out that bug! Keep them coming! > > > > Chris > > > > > > > > On Tue, 26 Oct 2004 21:38:02 +0000, Tiago Dionizio <tngd81@gmail.com> wrote: > > > I didn't try with 3.07, only started working with OCaml recently. > > > > > > Although this is a very rough attempt on locating the problem, this > > > might have something to do with it: > > > > > > on file win32caml/ocaml.c around the line 1319 here is what i found: > > > > > > ... > > > case WM_TIMERTICK: > > > /** Modified by Chris Watford 21 Sept 2003 **/ > > > hwndChild = (HWND) GetWindowLong(hwnd, DWL_USER); > > > > > > if (ReadToLineBuffer()) > > > { > > > int errMsg = 0; > > > char *p, *l = lineBuffer; > > > > > > // Ok we read something. Display the > > > trimmed version > > > while(((*l) == ' ') || ((*l) == '\t') > > > || ((*l) == '\n') || ((*l) == '\r') || ((*l) == '*')) > > > l++; > > > ... > > > > > > I have no idea why it trims empty spaces and the *'s. There may be a > > > good reason for this to happen.. but i did get very confused when this > > > happened to me the first time. > > > > > > Tiago > > > > > > > > > > > > > > > On Tue, 26 Oct 2004 09:06:01 -0700, David Brown <caml-list@davidb.org> wrote: > > > > On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > > > > > > > > > ># print_string "**e";; > > > > > >e- : unit = () > > > > > > > > > > Try flushing stdout. > > > > > > > > I don't think it will help, since the 'e' is getting printed, just not the > > > > '*'s before it. I don't see anything in the source that looks like it > > > > would cause this problem, but there might be something subtle. Did it > > > > happen with 3.07? The windows code changed quite a bit between. > > > > > > > > Dave > > > > > > > > > > _______________________________________________ > > > Caml-list mailing list. Subscription management: > > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > > > Archives: http://caml.inria.fr > > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > > > > -- > > Christopher A. Watford > > christopher.watford@gmail.com > > http://dorm.tunkeymicket.com > > > > -- > Christopher A. Watford > christopher.watford@gmail.com > http://dorm.tunkeymicket.com > -- Christopher A. Watford christopher.watford@gmail.com http://dorm.tunkeymicket.com ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] *s ignored on windows gui 2004-10-27 3:12 ` Christopher A. Watford @ 2004-10-27 11:34 ` Tiago Dionizio 0 siblings, 0 replies; 8+ messages in thread From: Tiago Dionizio @ 2004-10-27 11:34 UTC (permalink / raw) To: Caml Mailing List Hi, thanks for looking into it :) i see now why they were being trimmed, since the command line being used is not interactive and gets the input buffer as a whole it will output prompt characters for each line given on the "prompt". As i see it, the ocaml toplevel could have a new option to turn the prompt generation *off* so it didn't generate the prompt at all, another way (the dirty way) would be to count input lines and delete on the output 2 characters per input line (generated prompt chars). I don't how you are doing it now. But i think both options could work. Tiago On Tue, 26 Oct 2004 23:12:03 -0400, Christopher A. Watford <christopher.watford@gmail.com> wrote: > # > > print_char '*';; > *- : unit = () > # > > print_string " 3 spaces";; > _-_3 spaces- : unit = () > # > > I turned the spaces in the last example into an alternating pattern so > you could see nothing got trimmed! I'll get this code into CVS. > > As always, if you want the bleeding edge of OCamlWinPlus, I suggest > you check out (that is my actual VS.Net project directory): > http://projects.tunkeymicket.com/OCamlWinPlus/Release/ > > If you'd like the more stable side of the bleeding edge (stable > directory on my webserver that only takes polished copies): > http://dorm.tunkeymicket.com/OCamlWinPlus/Release/ > > Hope that helps! > > Chris > > On Tue, 26 Oct 2004 22:21:56 -0400, Christopher A. Watford > <christopher.watford@gmail.com> wrote: > > Here is some output from my recently applied changes: > > > > # print_string "**e";; > > **e- : unit = () > > # print_char '*';; > > *- : unit = () > > # print_char '\t';; > > - : unit = () > > # > > > > print_char '*';; > > *- : unit = () > > # > > > > Note the crappy leading space if you use lots of lines.... I'm not > > sure how I should go about checking for things like that. The old code > > removed all whilespace leading the output (and those *'s, hehe sorry). > > > > Is the desired functionality leaving the output intact? If so the > > above looks like this: > > > > # print_string "**e";; > > **e- : unit = () > > # print_char '*';; > > *- : unit = () > > # print_char '\t';; > > - : unit = () > > # > > > > print_char '*';; > > *- : unit = () > > # > > > > With only a bunch of leading white space when you use more than 1 > > line. Should I have it detect and remove 1 space for each extra line? > > The reality of what goes on is accurately shown below: > > > > # > > > > print_char '*';; > > *- : unit = () > > # > > > > Note I used no indentation between lines, and no indentation appeared > > in my output. I think it would require a bit of extra work, but I > > might could finagle keeping track of indentation for removal in the > > output. > > > > > > > > On Tue, 26 Oct 2004 20:30:28 -0400, Christopher A. Watford > > <christopher.watford@gmail.com> wrote: > > > Ok let me explain why I trim these. > > > > > > What happens when some luser forgets to terminate a comment, a string, > > > etc, the damn redirected shell process puts out either ' *' at the > > > front of a line, or just extra spaces. The actual variables etc aren't > > > being trimmed, just the output. > > > > > > I'll try and work around having to trim those with some more > > > intelligent checks for user input failures. > > > > > > Thanks for pointing out that bug! Keep them coming! > > > > > > Chris > > > > > > > > > > > > On Tue, 26 Oct 2004 21:38:02 +0000, Tiago Dionizio <tngd81@gmail.com> wrote: > > > > I didn't try with 3.07, only started working with OCaml recently. > > > > > > > > Although this is a very rough attempt on locating the problem, this > > > > might have something to do with it: > > > > > > > > on file win32caml/ocaml.c around the line 1319 here is what i found: > > > > > > > > ... > > > > case WM_TIMERTICK: > > > > /** Modified by Chris Watford 21 Sept 2003 **/ > > > > hwndChild = (HWND) GetWindowLong(hwnd, DWL_USER); > > > > > > > > if (ReadToLineBuffer()) > > > > { > > > > int errMsg = 0; > > > > char *p, *l = lineBuffer; > > > > > > > > // Ok we read something. Display the > > > > trimmed version > > > > while(((*l) == ' ') || ((*l) == '\t') > > > > || ((*l) == '\n') || ((*l) == '\r') || ((*l) == '*')) > > > > l++; > > > > ... > > > > > > > > I have no idea why it trims empty spaces and the *'s. There may be a > > > > good reason for this to happen.. but i did get very confused when this > > > > happened to me the first time. > > > > > > > > Tiago > > > > > > > > > > > > > > > > > > > > On Tue, 26 Oct 2004 09:06:01 -0700, David Brown <caml-list@davidb.org> wrote: > > > > > On Tue, Oct 26, 2004 at 05:49:20PM +0200, Alex Baretta wrote: > > > > > > > > > > > ># print_string "**e";; > > > > > > >e- : unit = () > > > > > > > > > > > > Try flushing stdout. > > > > > > > > > > I don't think it will help, since the 'e' is getting printed, just not the > > > > > '*'s before it. I don't see anything in the source that looks like it > > > > > would cause this problem, but there might be something subtle. Did it > > > > > happen with 3.07? The windows code changed quite a bit between. > > > > > > > > > > Dave > > > > > > > > > > > > > _______________________________________________ > > > > Caml-list mailing list. Subscription management: > > > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > > > > Archives: http://caml.inria.fr > > > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > > > > > > > > -- > > > Christopher A. Watford > > > christopher.watford@gmail.com > > > http://dorm.tunkeymicket.com > > > > > > > -- > > Christopher A. Watford > > christopher.watford@gmail.com > > http://dorm.tunkeymicket.com > > > > > -- > > > Christopher A. Watford > christopher.watford@gmail.com > http://dorm.tunkeymicket.com > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-10-27 11:34 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-10-26 12:20 *s ignored on windows gui Tiago Dionizio 2004-10-26 15:49 ` [Caml-list] " Alex Baretta 2004-10-26 16:06 ` David Brown [not found] ` <c5a3ec0104102610237b92dcaa@mail.gmail.com> 2004-10-26 21:38 ` Tiago Dionizio 2004-10-27 0:30 ` Christopher A. Watford 2004-10-27 2:21 ` Christopher A. Watford 2004-10-27 3:12 ` Christopher A. Watford 2004-10-27 11:34 ` Tiago Dionizio
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox