[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:03040] Re: Problem with getc under UNIX with ruby 1.4.3

From: "David Douthitt" <DDouthitt@...>
Date: 2000-05-30 15:20:35 UTC
List: ruby-talk #3040
Thanks for the help!  Now I'm trying to redefine IO.getc to include this behavior.... and not getting very far:

#!/usr/bin/ruby

class IO
   def getc
      begin
        system("stty raw -echo")
        str = self.getc
      ensure
        system("stty -raw echo")
      end
   end
end

str = STDIN.getc
p str

This code locks up - I think probably for semi-obvious reasons (self.getc IN getc) but I don't know how to call the "previous" getc from within a redefinition.  I tried super and it said there wasn't any.




In This Thread

Prev Next