[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with trailing comment in repl

From: Andy Wingo
Subject: Re: problem with trailing comment in repl
Date: Sat, 12 Feb 2011 15:36:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Sat 12 Feb 2011 14:21, "Jose A. Ortega Ruiz" <address@hidden> 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:

  2. User: one line of input:
     (exp-1) (exp-2)

  3. Guile: read one sexp

  4. Guile: flush whitespace; input state is:

  5. Guile: Input is ready, so don't print prompt, just read

  6. Guile: Flush whitespace, no input available, so print prompt:

> i was expecting a comment to be equivalent to whitespace.

We could add some hacks in that regard, but it wouldn't work for
ecmascript...  If there is input, Guile calls `read', not some
hypothetical `read-syntax' that could return a comment, and `read'
doesn't return until it has read an entire expression.

> However, i think there's a problem with metacommands at the
> "non-prompt":
>     scheme@(guile-user)> ;; foo
>     ,error
>     While compiling expression:
>     Syntax error:

Meta-commands have to be the first thing on the prompt.  It's a special
case to look for the comma character; once we've seen non-whitespace --
";" in this case -- we're in the scheme reader, not the repl reader.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]