Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange behaviour of ::tclreadline::Loop

26 views
Skip to first unread message

Cecil Westerhof

unread,
Jan 23, 2018, 10:44:07 AM1/23/18
to
When I have the following ~/.tclshrc:
if {${tcl_interactive}} {
package require tclreadline

::tclreadline::Loop
}

I get a very strange behaviour. When I enter:
expr {![catch {package present Tk}]}

I get what looks like a secondary prompt and the only sensible thing
it seems that I can do is Ctrl-c.

Nope, that is not completely true. If I enter a ] I get:
in
while evaluating {error in history expansion
![catch: event not found

]}


But when I remove the ::tclreadline::Loop I get the result I expect:
0
%

So am I doing something wrong, or did I find a bug in
::tclreadline::Loop?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Ted Nolan <tednolan>

unread,
Jan 23, 2018, 12:38:41 PM1/23/18
to
In article <874lnc4...@munus.decebal.nl>,
Cecil Westerhof <Ce...@decebal.nl> wrote:
>When I have the following ~/.tclshrc:
> if {${tcl_interactive}} {
> package require tclreadline
>
> ::tclreadline::Loop
> }
>
>I get a very strange behaviour. When I enter:
> expr {![catch {package present Tk}]}
>
>I get what looks like a secondary prompt and the only sensible thing
>it seems that I can do is Ctrl-c.
>
>Nope, that is not completely true. If I enter a ] I get:
> in
> while evaluating {error in history expansion
> ![catch: event not found
>
> ]}
>
>
>But when I remove the ::tclreadline::Loop I get the result I expect:
> 0
> %
>
>So am I doing something wrong, or did I find a bug in
>::tclreadline::Loop?
>

'!' is the history interpolation character for the readline package.

Add a space after it so it gets passed through to Tcl rather than the
loop trying to interpret it.
--
------
columbiaclosings.com
What's not in Columbia anymore..

Cecil Westerhof

unread,
Jan 23, 2018, 1:14:05 PM1/23/18
to
Yes, that was the problem. Thank you very much.
0 new messages