From: James Edward Gray II Date: 2005-10-10T07:01:27+09:00 Subject: Re: HighLine Issue (was Re: Lisp Game (#49)) On Oct 6, 2005, at 4:11 PM, Markus Koenig wrote: > Hello James, > > I really appreciate your and Greg's work. It's nice to see what can > evolve from a simple quiz idea. :) Thanks for the kind words. >> I'm very interested in understanding this problem and fixing it >> correctly. Could you please show a trivial HighLine script and how >> you are trying to use it, so I can wrap my head around this? >> > > I think HighLine's methods should either raise EOFError or return nil > if EOF is reached, but I'm not sure which one would be nicer. Maybe a > hybrid approach, like IO#gets and IO#readline? > > The trivial script, if the methods return nil: > > require 'highline/import' > loop do > name = ask("What's your name?") > if response.nil? or response == 'exit' > puts 'Goodbye, dear friend.' > exit > else > puts "Hello, #{name}!" > end > end > > I expect this program to behave like most Unix shells - quietly quit > when one presses Ctrl-D (EOF). But this would print a stack trace, as > shown earlier. I've added this to our TODO. It will be addressed in the next version of HighLine. James Edward Gray II