[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: support thunks as prompts without readline
From: |
Andy Wingo |
Subject: |
Re: support thunks as prompts without readline |
Date: |
Mon, 12 May 2008 21:15:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Hey Neil,
On Sat 10 May 2008 00:36, Neil Jerram <address@hidden> writes:
> Andy Wingo <address@hidden> writes:
>
>> * ice-9/boot-9.scm (repl-reader): Support thunks as prompts.
>> ---
>> ice-9/boot-9.scm | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
>> index d1e6306..b92cfd6 100644
>> --- a/ice-9/boot-9.scm
>> +++ b/ice-9/boot-9.scm
>> @@ -2518,7 +2518,7 @@
>> ;;; the readline library.
>> (define repl-reader
>> (lambda (prompt)
>> - (display prompt)
>> + (display (if (string? prompt) prompt (prompt)))
>> (force-output)
>> (run-hook before-read-hook)
>> ((or (fluid-ref current-reader) read) (current-input-port))))
>
> I don't get this one. Isn't the thunk option already covered by the
> code that calls repl-reader, here:
>
> (let ((prompt (cond ((string? scm-repl-prompt)
> scm-repl-prompt)
> ((thunk? scm-repl-prompt)
> (scm-repl-prompt))
> (scm-repl-prompt "> ")
> (else ""))))
> (repl-reader prompt))))
Sorry for the long quote. Answer: It does seem that this case is covered
by the scm-style REPL. I'm trying to use the repl-reader for a different
repl, the one in guile-vm. The (ice-9 readline) repl-reader does handle
the prompt-as-thunk case. I just want them both to act the same :)
I could change to call the thunk instead, if that's the best option.
Please advise as to what you want to accept.
Andy
--
http://wingolog.org/