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

On Sat, Feb 12 2011, Andy Wingo wrote:

> On Fri 11 Feb 2011 22:15, "Jose A. Ortega Ruiz" <jao@gnu.org> 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 nice if there were a prompt in this case.  However, it is
> difficult to do.  Because this case is very much like:
>
>    guile> (define a 3) (
>    <- no prompt, waiting for you to finish the expression
>
> Or indeed, like:
>    guile> ;; foo
>    <- no prompt
>
> After reading an expression, the REPL reader flushes any available
> whitespace, then goes into a new read.  If there are characters waiting
> on the current input port, as they are if there is more than one
> expression on one line, no prompt is printed.  In this case we flush the
> whitespace, and start reading at the ";", and keep on reading in the
> next line.

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; and the same happens for a sexp with trailing whitespace, and i
was expecting a comment to be equivalent to whitespace. But, anyway, you
know better than me how the reader works and i'm sure there are good
reasons for that behaviour. (And of course it is true that the case of
_only_ whitespace behaves as the one of only a comment.)

However, i think there's a problem with metacommands at the
"non-prompt":

    scheme@(guile-user)> ;; foo
    ,error
    While compiling expression:
    Syntax error:
    standard input:2:0: unquote: expression not valid outside of quasiquote
    in form (unquote error)
    scheme@(guile-user)> 

This happens with all metacommands i've tried, not just ,error.  Compare
to:

    scheme@(guile-user)>     
    ,error
    Nothing to debug.
    scheme@(guile-user)>


Cheers,
jao
-- 
Convictions are more dangerous enemies of truth than lies.
 -Friedrich Wilhelm Nietzsche, philosopher (1844-1900)



  reply	other threads:[~2011-02-12 13:21 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 [this message]
2011-02-12 14:36     ` Andy Wingo
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=8739ntbd8a.fsf@gnu.org \
    --to=jao@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).