From: John B. Matthews on
In article <ha7fvl$8g0$1(a)news.eternal-september.org>,
Jeff Higgins <oohiggins(a)yahoo.com> wrote:

> John B. Matthews wrote:
> > In article <7ig1fsF319h9fU1(a)mid.individual.net>,
> > Mike Amling <mamling(a)rmcis.com> wrote:
> >
> >> Surely someone somewhere must have something like this already, with
> >> classes or interfaces for time, distance, mass, etc.
> >
> > JSR-275: <http://jscience.org/api/index.html>
> >
> <https://jscience.dev.java.net/servlets/ReadMsg?list=dev&msgNo=654>

Thank you for responding. I'm not sufficiently familiar with the process
to understand the import of the discussion you cited. The measure
package was moved to javax.measure in anticipation of standardization as
part of JSR-275. Failing that, the code still seems useful. Is there
some reason to be wary?

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Roedy Green on
On Mon, 28 Sep 2009 23:25:39 -0700, Kevin McMurtrie
<kevinmcm(a)sonic.net> wrote, quoted or indirectly quoted someone who
said :

>(And yet the simple things
>like unsigned math

A ubyte type could be added without even changing the JVM. The
compiler could even just mindlessly add in & 0xff after every load.
There might be a problem finding bits to accommodate ubyte in the byte
codes.

for a uint, it not that onerous to use long and &0xffffffff; manually

for a ulong you truly need unsigned arithmetic. But one extra bit in
64 is not that big a prize.

My thinking is, ubyte is the main thing to go for. The current signed
bytes are too error prone, since 99% of the time you want ubyte.

--
Roedy Green Canadian Mind Products
http://mindprod.com

When you can�t find a bug, you are probably looking in the wrong place. When you can�t find your glasses, you don�t keep scanning the same spot because you are convinced that is where you left them.
~ Roedy
From: Roedy Green on
On Tue, 29 Sep 2009 21:35:22 +0200, Michal Kleczek <kleku75(a)gmail.com>
wrote, quoted or indirectly quoted someone who said :

>1. Option types
>Whatever the name of the feature - I'd like to be able to mark a variable as
>not null (I would actually prefer to mark variables as nullable but that
>would not be backwards compatible). And I don't think adnotations are
>enough.

IntelliJ Idea has as system where you can mark parameters and return
results as @Nullable or @NotNull.

You have to provide a special annotations.jar file to the compiler.

@Nullable means the value may potentially be null, &NotNull means it
may not.

I understand the intent, but I don't understand how they work. It may
be they are only examined during lint (code inspector).

--
Roedy Green Canadian Mind Products
http://mindprod.com

When you can�t find a bug, you are probably looking in the wrong place. When you can�t find your glasses, you don�t keep scanning the same spot because you are convinced that is where you left them.
~ Roedy
From: Roedy Green on
On Tue, 29 Sep 2009 21:35:22 +0200, Michal Kleczek <kleku75(a)gmail.com>
wrote, quoted or indirectly quoted someone who said :

>Whatever the name of the feature - I'd like to be able to mark a variable as
>not null (I would actually prefer to mark variables as nullable but that
>would not be backwards compatible). And I don't think adnotations are
>enough.

The feature of the Nice language most intriguing to Java programmers
is it gets rid of the NullPointerExceptions by determining at compile
time if they could happen.

This sounds impossible to me. I can see getting rid of some, but not
all, unless you make programmers do explicit null checks any place
they could cause trouble.

http://nice.sourceforge.net/index.html

--
Roedy Green Canadian Mind Products
http://mindprod.com

When you can�t find a bug, you are probably looking in the wrong place. When you can�t find your glasses, you don�t keep scanning the same spot because you are convinced that is where you left them.
~ Roedy
From: Roedy Green on
On Mon, 28 Sep 2009 18:36:42 -0500, Jim <jkorman(a)alltel.net> wrote,
quoted or indirectly quoted someone who said :

>
>Roedy, Sounds like Pascal Type declarations, which is one of the
>things I really miss in Java.
>
>Jim

In Abundance, my home brew language, I had a bounded int type, with an
enforced lower and upper bound. The bounds were used to generate
keying prompts and validation.

I first developed a lust for this light-weight type feature writing a
crash-proof disk-based cached Btree implementation back in the 70s,
where there were a bewildering number of arrays and subscripts. The
error I kept making was using the wrong subscript with a given array.
I wanted a way to tie subscripts and arrays so they had to be used
together, with any inconsistencies detected at compile time. Another
way of thinking of this is my index variable was in ordinary int, but
of a special type that could only be used to index certain arrays.

Earlier, circa 1973, I was keen on units of measure. Canada was in
the process of converting Imperial measure to metric. Engineering
computer programs were a hash of units, and bugs were frequent from
mismatches. I figured if every value were given a unit of measure,
the compiler could guarantee consistency, and even apply guaranteed
correct conversion constants. It could even check dimension
consistency in engineering formulae. e.g. speed is length/time
dimensionality. You could not assign a length/time^2 expression to
it.

I recall my delight at learning about dimensionality in high school.
It could even tell you the form some physics equation had to take
before you had even done any analysis of the physics.


..


--
Roedy Green Canadian Mind Products
http://mindprod.com

When you can�t find a bug, you are probably looking in the wrong place. When you can�t find your glasses, you don�t keep scanning the same spot because you are convinced that is where you left them.
~ Roedy
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Prev: Putting passwords in a properties file?
Next: Interview