Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26140
| From | Arved Sandstrom <asandstrom3minus1@eastlink.ca> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Why “new”? |
| References | (1 earlier) <iiikhp$7s4$1@news.eternal-september.org> <4d4cd875@news.x-privat.org> <4d4d617f$0$23763$14726298@news.sunsite.dk> <kLd3p.62928$ZS4.61193@newsfe07.iad> <4d4e3087@news.x-privat.org> |
| Message-ID | <C4x3p.72003$Y8.16393@newsfe06.iad> (permalink) |
| Organization | Public Usenet Newsgroup Access |
| Date | 2011-02-06 09:09 -0400 |
On 11-02-06 01:24 AM, Ken Wesson wrote:
> On Sat, 05 Feb 2011 11:10:07 -0400, Arved Sandstrom wrote:
>
[ SNIP ]
>> And I wouldn't mind seeing proper bounds checking in that little code
>> snippet from Ken.
>
> That code snippet inherits Java's bounds checking, since it's Clojure
> code. :) So it won't crash anything. Of course if the matrices are
> incompatible for multiplication it will screw up. Actually, it will
> truncate one or both matrices along some dimension, and multiply a
> maximal multiply-compatible pair of submatrices.
[ SNIP ]
>
> So the question is, what did you mean by bounds checking? If you meant
> "make sure not to walk off the end of an array and crash" then they won't
> crash. If you meant "make sure the 'matrix' isn't actually ragged-right,
> and that matrices are compatible for multiplication" then they won't
> throw exceptions on those conditions, and instead will return probably-
> garbage results.
>
The latter was what I meant. I don't consider a matrix multiplication
language comparison example to be complete unless it demonstrates that
kind of checking. I'm not anal about it - a bit of handwaving that says
that a matrix type ("class" or similar) exists that takes care of some
of the checking at construction time is cool. But you'd certainly want
to show the compatibility check.
AHS
--
We must recognize the chief characteristic of the modern era - a
permanent state of what I call violent peace.
-- James D. Watkins
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar
Re: Why “new”? Ken Wesson <kwesson@gmail.com> - 2011-02-05 05:56 +0100
Re: Why “new”? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-02-05 11:10 -0400
Re: Why “new”? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-02-06 09:09 -0400
csiph-web