unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: "Jose A. Ortega Ruiz" <jao@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: problem with trailing comment in repl
Date: Sat, 12 Feb 2011 15:36:00 +0100	[thread overview]
Message-ID: <m3tyg99v73.fsf@unquote.localdomain> (raw)
In-Reply-To: <8739ntbd8a.fsf@gnu.org> (Jose A. Ortega Ruiz's message of "Sat,  12 Feb 2011 14:21:09 +0100")

On Sat 12 Feb 2011 14:21, "Jose A. Ortega Ruiz" <jao@gnu.org> 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 line of input:
     (exp-1) (exp-2)

  3. Guile: read one sexp

  4. Guile: flush whitespace; input state is:
     (exp-2)

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

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

> 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.

Regards,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2011-02-12 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 21:15 problem with trailing comment in repl Jose A. Ortega Ruiz
2011-02-12 12:34 ` Andy Wingo
2011-02-12 13:21   ` Jose A. Ortega Ruiz
2011-02-12 14:36     ` Andy Wingo [this message]
2011-02-13 15:22       ` Noah Lavine
2011-02-13 19:19         ` Andy Wingo
2011-02-13 21:27           ` Noah Lavine
2011-02-14 10:09             ` Ludovic Courtès
2011-02-15  2:42               ` Noah Lavine
2011-03-03 22:56             ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tyg99v73.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=jao@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).