in reply to RFC: POE::Wheel::ReadLine::Gnu

You should point POE's mailing list to this post. I think the Morgan Stanley people who wrote large chunks of POE::Wheel::ReadLine read the list, and they may be interested in a relatively inexpensive way to complete the readline feature set.

Have you checked whether POE::Wheel::ReadLine::Gnu passes POE::Wheel::ReadLine's tests? If so, it might be a viable replacement for the existing module.

Replies are listed 'Best First'.
Re^2: RFC: POE::Wheel::ReadLine::Gnu
by shmem (Chancellor) on Feb 09, 2008 at 21:33 UTC
    Have you checked whether POE::Wheel::ReadLine::Gnu passes POE::Wheel::ReadLine's tests?

    Not yet, since I'm pretty sure it doesn't pass the tests - for now. I wanted to have that working first, and care about compatibility and tests later... Ill update the OP with results as I get them.

    Thanks for answering; I'll notice the mailing list.

    update: ...and thank you for POE! It rocks! ;-)

    update 2: Test output:

    perl t/30_loops/00_base/wheel_readline-gnu.pm 1..6 ok 1 - plain typing ok 2 - backspace ok 3 - forward/backward not ok 4 - delete words # Failed test 'delete words' # at t/30_loops/00_base/wheel_readline-gnu.pm line 306. # got: ' two four' # expected: 'two four' ok 5 - case changes not ok 6 - transpose # Failed test 'transpose' # at t/30_loops/00_base/wheel_readline-gnu.pm line 306. # got: 'two one 12' # expected: 'two one 21' # Looks like you failed 2 tests of 6.

    The failures only show differences between the two implementations; for GNU readline:

    • 'delete words' - killing a word at bol (beginning-of-line) doesn't kill a following space
    • 'transpose' - transposing two previous chars is possible at eol

    The tests for POE::Wheel::ReadLine are far from complete; I didn't yet look into the arguments to new() and how they would translate to P::W::RL::Gnu, so I suspect incompatibilities in areas not covered by the tests (yet).

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re^2: RFC: POE::Wheel::ReadLine::Gnu
by shmem (Chancellor) on Feb 11, 2008 at 23:20 UTC
    I think the Morgan Stanley people (...) may be interested in (...) a viable replacement for the existing module.

    SCNR to the temptation of giving an example of how easy it is to twist a whole statement with the use of some ellipsis... ;-)

    It might be a viable replacement, and if refined, it is; and "relatively inexpensive way" is an understatement, because all there is to it already can be found in the GNU readline library.

    Dunno how that has been in the beginning of POE::Wheel::ReadLine. As for now, calling the GNU RL lib via Term::ReadLine::Gnu in POE context is straightforward, since it supports the callback execution model.

    The functions needed in POE context, for most of its functionality, are:

    • $self->rl_callback_handler_install
    • $self->rl_callback_read_char
    • $self->rl_deprep_terminal
    • $self->rl_insert_text
    • $self->rl_set_prompt
    • $self->rl_redisplay

    all of which (and oodles of more functions) are nicely explained in the GNU readline info pages.

    I could step in and release a POE::Wheel::ReadLine::Gnu module compatible to POE::Wheel::ReadLine, and I would do so if you as "grandfather POE" would favor that; but I'd rather have the original authors of P:W:RL ("the Morgan Stanley people" ?) do the revision, for they have more insight into POE. Besides, I don't want to take over things without need, nor spoil effort.

    That said - if nobody answers on the mailing list, I'll just do my best in coding and post it here or send it to you for inclusion.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}