Re: problem with trailing comment in repl

2011-03-03 Thread Andy Wingo
On Sun 13 Feb 2011 22:27, Noah Lavine writes: > The attached patch does it. I almost hate to commit it because it's > such a hack, but this is from my last Guile session: > > scheme@(guile-user)> 'foo > $2 = foo > scheme@(guile-user)> 'foo ; hi there! > $3 = foo > scheme@(guile-user)> ; why, hell

Re: problem with trailing comment in repl

2011-02-14 Thread Noah Lavine
Hello, > Nice!  Can you add a test case? I've thought about it, and I'm not sure how to do it well. The trouble is that this only applies to the REPL, not scripts. So a test would have to wrap the REPL in something and make sure its output is right. I might be able to do that, but if I just comp

Re: problem with trailing comment in repl

2011-02-14 Thread Ludovic Courtès
Hi! Noah Lavine writes: > The attached patch does it. I almost hate to commit it because it's > such a hack, but this is from my last Guile session: > > scheme@(guile-user)> 'foo > $2 = foo > scheme@(guile-user)> 'foo ; hi there! > $3 = foo > scheme@(guile-user)> ; why, hello! > scheme@(guile-us

Re: problem with trailing comment in repl

2011-02-13 Thread Noah Lavine
The attached patch does it. I almost hate to commit it because it's such a hack, but this is from my last Guile session: scheme@(guile-user)> 'foo $2 = foo scheme@(guile-user)> 'foo ; hi there! $3 = foo scheme@(guile-user)> ; why, hello! scheme@(guile-user)> ,q Noah On Sun, Feb 13, 2011 at 2:19

Re: problem with trailing comment in repl

2011-02-13 Thread Andy Wingo
Hi Noah, I think it makes sense to have a reader that actually returns comments. That, to me, is the general solution: the REPL reader just treats a comment as whitespace. On Sun 13 Feb 2011 16:22, Noah Lavine writes: > - The quicker way: if the language in use is scheme, change the > next-char

Re: problem with trailing comment in repl

2011-02-13 Thread Noah Lavine
Hello all, I was thinking about how this might be solved. I can see two ways of doing it: - The nicer way: add a new read function (or a keyword argument to the current read function) that can tell it to stop without returning anything if it hits a newline and there's no more input ready on its p

Re: problem with trailing comment in repl

2011-02-12 Thread Andy Wingo
On Sat 12 Feb 2011 14:21, "Jose A. Ortega Ruiz" writes: > I'm not sure i understand this reasoning, because when there are two (or > more) complete sexps in a line they're accepted, and a new prompt > appears; Of course. 1. Guile: No input available, print prompt: guile> 2. User: one

Re: problem with trailing comment in repl

2011-02-12 Thread Jose A. Ortega Ruiz
On Sat, Feb 12 2011, Andy Wingo wrote: > On Fri 11 Feb 2011 22:15, "Jose A. Ortega Ruiz" writes: > >> scheme@(guile-user)> (define a 3) ;; foo >> <- cursor stays here; no prompt >> >> is that intended? i'm hoping it is not, because it confuses geiser, who >> is waiting for a new prompt to

Re: problem with trailing comment in repl

2011-02-12 Thread Andy Wingo
On Fri 11 Feb 2011 22:15, "Jose A. Ortega Ruiz" writes: > scheme@(guile-user)> (define a 3) ;; foo > <- cursor stays here; no prompt > > is that intended? i'm hoping it is not, because it confuses geiser, who > is waiting for a new prompt to mark the end of the transaction. It would be n