[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Redefining write()
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 09 Aug 1999 10:03:08 -0300
> Is it legitimate to compare "if _OUTPUT = _STDOUT then ..."?
Yes, no problem at all (well, you need to use "==" instead of "=" ;-).
> Is it further legal to compare an object of unspecified type to _STDOUT to
> test if it is the stdout file handle? (I'm assuming that if the type isn't
> userdata then the compare will fail quickly based solely on type.)
> I also wonder why the ishandle() routine in the iolib isn't exposed in
> the API? Will I need that function to handle this "properly"?
function ishandle (h)
return tag(h) == tag(_STDIN)