Hello John,
"John C. Bollinger" <>, Wed, 02 Jul 2003 16:47:28
-0500:
> dhek bhun kho wrote:
>> "John C. Bollinger" <>, Wed, 02 Jul 2003 09:56:26
>> -0500:
>>>Roedy Green wrote:
>>>>With a tiny bit more ambition on the part of compiler writers, ranges
>>>>too could also be handled much more efficiently than typically hand
>>>>coded nested ifs.
>>>
>>>That is a feature I would love to have. (And it has been available in
>>>Fortran since Fortran-90, BTW. I don't know how Sun lives with itself,
>>>knowing that Java is trailing behind Fortran.
)
>>
>> It would save some typing I guess. Does Fortran do things like the
>> EVALUATE in COBOL?
>>
>> EVALUATE x ALSO y ALSO z ALSO TRUE
>> WHEN 1 ALSO 2 ALSO 3 THRU 10 ALSO fun
>> PERFORM haha
>> WHEN 2 ALSO 3 ALSO 11 THRU 12 ALSO fun
>> PERFORM hahaha
>> END-EVALUATE
>>
>> Haven't seen anything like this in any other other language.
>
> Fortran's version is structurally more like C and Java. Example:
>
> select case (foo)
> case (:-1)
> do stuff
> case (0, 2, 4, 6:57)
> do something else
> case default
> do something different
> end select
>
> The Fortran version has no fall-through. It supports a very flexible
Sorry, I do not understand what you mean with fall-through. (Not a native
speaker).
> and IMO intuitive syntax including open- and closed-ended value ranges
> and sequences of values and value ranges. It also supports character
> case values (the Fortran analogue of Java Strings) but not mixed with
> integer case values or selection expressions. I think it would be a
> inappropriate for Java to tie the String class to a control construct,
Isn't this related to the fact that although two Strings might have the
same content, they are not always equal? (Unless you make sure they are
always internalized).
I do find it a loss, that Java does not support ranges (eg.
Modula-2) or enumerations. You can always code it as a
separate class, but it's awkward.
> but it sure would be convenient to have something similar to the Fortran
> flavor of expressing case values.
Is anything like this coming up in the 1.5 release?
> But lest we miss an important point, do I understand that Java is also
> lagging behind COBOL?!? 
>
Hahaha. YES!

Just kidding. I like Java, while it is not the end of the
world or anything, it's a nuisance to keep typing thing like MOVE ADD
CALCULATE and such.
What I liked about COBOL was how easy it is to do file operations. Yes,
they are platform dependent, but coding a persistent data structure was
almost trivial in COBOL. I have not seen any COBOL-2000 code though.
I find it odd that there are no standard facilities for easy persistence
with low memory usage. Everything is serial(!). As soon I want to perform
random access, I have to code every detail; or resort to a database
solution. (I am not coding any application creating 2e6 application). The
other solution would be read the whole file into memory, but that's like
swatting a fly with a sledge hammer.
It seems a lot easier to write the persistence code in COBOL, write some
JNI wrappers and call it from Java. I would not want to code an user
interface in COBOL.
> John Bollinger
>
Greets.
Bhun.