|
List Info
Thread: Ctrl+d, interactive mode and REPL
|
|
| Ctrl+d, interactive mode and REPL |

|
2006-02-15 17:58:53 |
>>>>> "Samium" == Samium Gromoff
<_deepfire mail.ru> writes:
Samium> On Wed, 2006-02-15 at 08:54 -0500, Raymond
Toy wrote:
>> >>>>> "Samium" ==
Samium Gromoff <_deepfire mail.ru> writes:
>>
Samium> Is it possible to make cmucl exit when ctrl+d
is pressed in the REPL,
Samium> the same was as many of the UNIX`s
interactive tools do?
>>
>> There is a constant that controls this and
it's set to 10, so 10 C-d's
>> are needed to exit. I once changed it to a
defvar and set it to 1.
>> Even then it didn't really do what you want.
You have to press C-d
>> and return. That caused cmucl to switch input
from standard-input to
>> terminal-input. Another C-d/Return exited
cmucl.
Samium> That`s for top level frame, yes, but what
about inner, debug frames?
What do you want C-d to do on a debug frame?
Samium> This might look like a compromise to the UNIX
side, as per the
Samium> Unix Haters Handbook, but nevertheless it
would be a great convenience
Samium> to have this feature.
>>
>> Having accidentally exited clisp before, I find
it rather annoying,
>> especially when my Lisp contained lots of state
that I wasn't ready to
>> destroy it yet.
Samium> Perhaps it could be made configurable?
It was configurable. You could (setf *eofs* 0) and exit
(sort of) on
the first C-d/Return.
I never bothered to check in this change.
And you probably don't want to have to press C-d and
Return, but
that's how the current code works, because (I think), the
input is
line-buffered.
Ray
|
|
| Ctrl+d, interactive mode and REPL |

|
2006-02-15 21:12:49 |
On Wed, 2006-02-15 at 12:58 -0500, Raymond Toy wrote:
> >>>>> "Samium" == Samium
Gromoff <_deepfire mail.ru> writes:
> Samium> That`s for top level frame, yes, but
what about inner, debug frames?
>
> What do you want C-d to do on a debug frame?
Preferably to jump out to the toplevel, or just one debug
frame
outwards, i`m not sure what would make more sense...
> Samium> This might look like a compromise to the
UNIX side, as per the
> Samium> Unix Haters Handbook, but nevertheless
it would be a great convenience
> Samium> to have this feature.
> >>
> >> Having accidentally exited clisp before, I
find it rather annoying,
> >> especially when my Lisp contained lots of
state that I wasn't ready to
> >> destroy it yet.
>
> Samium> Perhaps it could be made configurable?
>
> It was configurable. You could (setf *eofs* 0) and
exit (sort of) on
> the first C-d/Return.
>
> I never bothered to check in this change.
>
> And you probably don't want to have to press C-d and
Return, but
> that's how the current code works, because (I think),
the input is
> line-buffered.
Yes, i`m thinking along the lines of having an instant exit
upon a C-d
in toplevel...
> Ray
regards, Samium Gromoff
|
|
| Ctrl+d, interactive mode and REPL |

|
2006-03-10 18:47:16 |
On Wed, 2006-02-15 at 21:12 +0000, Samium Gromoff wrote:
> On Wed, 2006-02-15 at 12:58 -0500, Raymond Toy wrote:
> > >>>>> "Samium" ==
Samium Gromoff <_deepfire mail.ru> writes:
> > Samium> That`s for top level frame, yes,
but what about inner, debug frames?
> >
> > What do you want C-d to do on a debug frame?
>
> Preferably to jump out to the toplevel, or just one
debug frame
> outwards, i`m not sure what would make more sense...
>
> > Samium> This might look like a compromise
to the UNIX side, as per the
> > Samium> Unix Haters Handbook, but
nevertheless it would be a great convenience
> > Samium> to have this feature.
> > >>
> > >> Having accidentally exited clisp
before, I find it rather annoying,
> > >> especially when my Lisp contained
lots of state that I wasn't ready to
> > >> destroy it yet.
> >
> > Samium> Perhaps it could be made
configurable?
> >
> > It was configurable. You could (setf *eofs* 0)
and exit (sort of) on
> > the first C-d/Return.
> >
> > I never bothered to check in this change.
> >
> > And you probably don't want to have to press C-d
and Return, but
> > that's how the current code works, because (I
think), the input is
> > line-buffered.
>
> Yes, i`m thinking along the lines of having an instant
exit upon a C-d
> in toplevel...
Thing is, there is a workflow where one often does a cycle
resembling
this:
10 cmucl -eval '(load "somestuff.lisp")'
20 *observe error messages*
30 *type in (quit) by hand*
40 *fix things*
50 goto 10
So, just being able to Ctrl-d out of anyplace in debug stack
would be a major aid.
regards, Samium Gromoff
P.S. Sorry for the notation
|
|
| Ctrl+d, interactive mode and REPL |

|
2006-03-11 22:59:33 |
Samium Gromoff wrote:
[snip]
>
> Thing is, there is a workflow where one often does a
cycle resembling
> this:
>
> 10 cmucl -eval '(load "somestuff.lisp")'
> 20 *observe error messages*
> 30 *type in (quit) by hand*
> 40 *fix things*
> 50 goto 10
>
> So, just being able to Ctrl-d out of anyplace in debug
stack
> would be a major aid.
>
This is a fairly unusual workflow in lisp. At the very
least, you'd at
least use the repl and (load "somestuff.lisp"),
read the messages, fix
somestuff.lisp and load it again. (Actually, you'd
probably compile it
too.)
A far more typical and productive workflow would be to use
slime (or
ilisp) to do this. Then you can have slime put you in
exactly the spot
in somestuff.lisp where the errors occur. And if you do get
into the
debugger, pressing "q" in the slime debugger
gets you out of the debugger.
I think this is way most people never notice that Ctrl-D
doesn't exit
immediately.
Ray
|
|
| Ctrl+d, interactive mode and REPL |

|
2006-03-11 22:59:33 |
Samium Gromoff wrote:
[snip]
>
> Thing is, there is a workflow where one often does a
cycle resembling
> this:
>
> 10 cmucl -eval '(load "somestuff.lisp")'
> 20 *observe error messages*
> 30 *type in (quit) by hand*
> 40 *fix things*
> 50 goto 10
>
> So, just being able to Ctrl-d out of anyplace in debug
stack
> would be a major aid.
>
This is a fairly unusual workflow in lisp. At the very
least, you'd at
least use the repl and (load "somestuff.lisp"),
read the messages, fix
somestuff.lisp and load it again. (Actually, you'd
probably compile it
too.)
A far more typical and productive workflow would be to use
slime (or
ilisp) to do this. Then you can have slime put you in
exactly the spot
in somestuff.lisp where the errors occur. And if you do get
into the
debugger, pressing "q" in the slime debugger
gets you out of the debugger.
I think this is way most people never notice that Ctrl-D
doesn't exit
immediately.
Ray
|
|
[1-5]
|
|