[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] Re: [OT] Java is fun!
From: |
Momchil Velikov |
Subject: |
Re: [Gnu-arch-users] Re: [OT] Java is fun! |
Date: |
23 Oct 2003 10:10:53 +0300 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Tom" == Tom Lord <address@hidden> writes:
Tom> To briefly reiterate, the above code is compiled at a time or location
Tom> where:
Tom> Reader.getLinesOfFiles
Tom> is declared with:
Tom> throws IOException;
Tom> and
Tom> Parser.parseLines
Tom> is declared with:
Tom> throws ParserException;
Tom> and it seems (according to _your_ claims (among others) about the
Tom> meaning of throws declarations) that the author of a code snippet such
Tom> as the above can reasonably assume:
Tom> the body of 'catch (IOException e)'
Tom> is reached because an exception is thrown from
Tom> Reader.getLinesOfFiles
Tom> the body of 'catch (ParserException e)'
Tom> is reached because an exception is thrown from
Tom> Parser.parseLines
Tom> Yet the language specs prove that such an assumption is _false_ unless
Tom> I (externally to Java) ensure that the code snippet is linked with the
Tom> same versions of Reader and Parser it was compiled against. Do you
Tom> claim I have misundersood the spec? If so, how?
This is relevant to probably _any_ language, in particular C:
Consider changing [1]
struct dirent *readdir(DIR *dir);
to
int readdir (DIR *DIRSTREAM, struct dirent *ENTRY,
struct dirent **RESULT);
and linking an executable compiled against the first declaration to a
library compiled against the second one.
~velco
[1] (apparently someone didn't think about backward compatibility (or
deliberately wanted to break programs, so they are "fixed" :), just
like in your Java example)
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, (continued)
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Dustin Sallings, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Tom Lord, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Dustin Sallings, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Miles Bader, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Tom Lord, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Tom Lord, 2003/10/22
- [Gnu-arch-users] Re: [OT] Java is fun!, zander, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Tom Lord, 2003/10/22
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Thomas Zander, 2003/10/23
- [Gnu-arch-users] Re: [OT] Java is fun!, Miles Bader, 2003/10/23
- Re: [Gnu-arch-users] Re: [OT] Java is fun!,
Momchil Velikov <=
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Tom Lord, 2003/10/23
- [Gnu-arch-users] Re: [OT] Java is fun, zander, 2003/10/24
- Re: [Gnu-arch-users] Re: [OT] Java is fun!, Mark A. Flacy, 2003/10/24
- Re: [Gnu-arch-users] Nit, Robin Farine, 2003/10/22
- Re: [Gnu-arch-users] Nit, Andrew Suffield, 2003/10/22
- Re: [Gnu-arch-users] Nit, Tom Lord, 2003/10/22
- Re: [Gnu-arch-users] Nit, David Brown, 2003/10/22
- Re: [Gnu-arch-users] Nit, Neal D. Becker, 2003/10/22
- Re: [Gnu-arch-users] Nit, Robin Farine, 2003/10/22
- error_t (was Re: [Gnu-arch-users] Nit), Tom Lord, 2003/10/22