Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: kbhit()

From: holger::rebol::com at: 22-Jun-2001 13:12

On Fri, Jun 22, 2001 at 12:18:52PM -0700, Jeff Kreis wrote:
> What are you trying to do, Holger? > One up me or something??? > ;-)
> > con: open/direct/binary/no-wait console:// > > until [wait con] > > choice: to-char pick con 1 > > > > No crazy poll loops needed :-). > > Gahh.. huh?? Above's a busy loop, especially with no-wait, eh? > Above loops away waiting for a single char.
No. /no-wait just means that 'copy does not block. No busy-wait there.
> to-char first wait open/direct/binary console:// > > Above waits (no loop) for a single char and returns it.
Yes, but assuming that wait always returns the port you are waiting for is not quite safe, in particular not in future versions of REBOL where background port handlers can trigger a 'wait wakeup based on some event... Having the 'until around it is safer. -- Holger Kruse [holger--rebol--com]