Primitive overflow is a JVM feature, partly caused by the behaviour of
underlying hardware.  The only workaround (in any language on the platform)
is to use BigInteger/BigDecimal.  Scala only helps here insofar as it allows
you to use these types with conventional arithmetic operators.

I wouldn't draw an analogy between overflow and checked exceptions here.
 Primitive behaviour is driven by considerations of performance and the
nature of CPU opcodes.  By comparison, checked exceptions are a pure design
choice, one that actually harms performance if (ab)used for flow control.



On 24 September 2010 01:00, Miroslav Pokorny <miroslav.poko...@gmail.com>wrote:

>
> Nevertheless, checked exceptions (even when handled better than C++) are
>> still a lie.  Not to the compiler but to the developer, which is far worse!
>>  They're a lie about the full range of exceptions a function might throw,
>> and they're a lie about how well a caller might deal with such an exception.
>>
>>
> They are not but a practical distinction. One cannot be pragmatic about
> everything otherwise nothing would get done. I suppose the primitive types
> are lie as well because most of the time they can hold some value but they
> occassionally overflow. Unfortunately we just deal; with it and try and get
> the job done. What about primitive value overflow in Scala ???
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to javapo...@googlegroups.com.
> To unsubscribe from this group, send email to
> javaposse+unsubscr...@googlegroups.com<javaposse%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>



-- 
Kevin Wright

mail / gtalk / msn : kev.lee.wri...@gmail.com
pulse / skype: kev.lee.wright
twitter: @thecoda

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javapo...@googlegroups.com.
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to