Re: #78: getCh

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: #78: getCh

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#78: getCh
----------------------+-----------------------------------------------------
  Reporter:  guest    |       Owner:  nobody
      Type:  defect   |      Status:  closed
  Priority:  minor    |   Milestone:        
 Component:  hugs     |     Version:  200609
Resolution:  wontfix  |    Keywords:        
----------------------+-----------------------------------------------------
Changes (by ross):

  * status:  new => closed
  * resolution:  => wontfix

Comment:

 It was a Hugs-only function, and now it's gone.  You should be able to get
 the same effect with `hSetBuffering` and `hSetEcho` (from `System.IO`).

--
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/78#comment:1>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell
_______________________________________________
Hugs-Bugs mailing list
Hugs-Bugs@...
http://www.haskell.org/mailman/listinfo/hugs-bugs

Re: #78: getCh

by Richard Bird :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Of course, I tried that before sending a bug,
but it doesn't work.

For example,

 > getCh = do {hSetBuffering stdin NoBuffering;
 >             hSetEcho stdin False;
 >             x <- getChar;
 >             hSetEcho stdin True;
 >             return x}

 > getMyLine = do {x <- getCh;
 >                 if x=='\n' then
 >                 do {putChar x; return ""}
 >                 else
 >                 do {if x=='b' then
 >                     putStr "\b \b"
 >                     else putChar x;
 >                     xs <- getMyLine;
 >                     return (x:xs)} }

doesn't work in the expected way.

Hugs wrote:

> #78: getCh
> ----------------------+-----------------------------------------------------
>   Reporter:  guest    |       Owner:  nobody
>       Type:  defect   |      Status:  closed
>   Priority:  minor    |   Milestone:        
>  Component:  hugs     |     Version:  200609
> Resolution:  wontfix  |    Keywords:        
> ----------------------+-----------------------------------------------------
> Changes (by ross):
>
>   * status:  new => closed
>   * resolution:  => wontfix
>
> Comment:
>
>  It was a Hugs-only function, and now it's gone.  You should be able to get
>  the same effect with `hSetBuffering` and `hSetEcho` (from `System.IO`).
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Hugs-Bugs mailing list
> Hugs-Bugs@...
> http://www.haskell.org/mailman/listinfo/hugs-bugs
_______________________________________________
Hugs-Bugs mailing list
Hugs-Bugs@...
http://www.haskell.org/mailman/listinfo/hugs-bugs

Re: #78: getCh

by Ross Paterson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 17, 2007 at 04:50:21PM +0100, Richard Bird wrote:
>> It was a Hugs-only function, and now it's gone.  You should be able to
>> get the same effect with `hSetBuffering` and `hSetEcho` (from `System.IO`).
>
> Of course, I tried that before sending a bug,
> but it doesn't work.

OK, there's a bug in setBuffering on terminals, now fixed in the
development version.  (untested on Windows, though.)
_______________________________________________
Hugs-Bugs mailing list
Hugs-Bugs@...
http://www.haskell.org/mailman/listinfo/hugs-bugs