A
Ara.T.Howard
rubyists-
any strong opinions on handling errno from c extentions?
personally, it seems that one would want to raise an exception like
Errno::EACCESS
when errno == EACCESS
however i see many cases where functions simply return Qfalse, Qtrue, etc. for
broad catagories of errno values - leaving the user to guess as to the cause
of the error (eg. rb_file_flock). is there are way of getting at errno that i
am unaware of? if so perhaps this is o.k....
IMHO a VHLL like ruby should either
a) succeed
b) throw an error
and one should never explcitly need to check error codes.
-a
--
ATTN: please update your address books with address below!
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================
any strong opinions on handling errno from c extentions?
personally, it seems that one would want to raise an exception like
Errno::EACCESS
when errno == EACCESS
however i see many cases where functions simply return Qfalse, Qtrue, etc. for
broad catagories of errno values - leaving the user to guess as to the cause
of the error (eg. rb_file_flock). is there are way of getting at errno that i
am unaware of? if so perhaps this is o.k....
IMHO a VHLL like ruby should either
a) succeed
b) throw an error
and one should never explcitly need to check error codes.
-a
--
ATTN: please update your address books with address below!
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================