Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15074

Re: eerie Java-BASIC (partially OT)

From BGB <cr88192@hotmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: eerie Java-BASIC (partially OT)
Date 2012-06-05 09:22 -0500
Organization albasani.net
Message-ID <jql4sa$4ee$1@news.albasani.net> (permalink)
References (1 earlier) <4fca25a2$0$284$14726298@news.sunsite.dk> <jqgad6$bp7$1@news.albasani.net> <jqgd0b$hfj$1@news.albasani.net> <jqgibp$4e8$1@news.albasani.net> <jqgkkv$9m3$1@news.albasani.net>

Show all headers | View raw


On 6/3/2012 4:23 PM, Lew wrote:
> On 06/03/2012 01:42 PM, BGB wrote:
>> On 6/3/2012 2:13 PM, Lew wrote:
>>> BGB wrote:
>>>> Arne Vajhøj wrote:
>>>>> If you with VB means VB.NET then you are absolutely correct.
>>>>>
>>>>> VB.NET is C# with VB syntax and C# is close to a superset of Java.
>>>>
>>>> generally, yes.
>>>>
>>>> but, a person could try to argue that they are "totally different", say
>>>> because of using "namespace" and "using" rather than "package" and
>>>> "import",
>>>> and ":" in class definitions instead of "extends" and "implements", ...
>>>>
>>>> however, these are likely minor differences (many are primarily
>>>> cosmetic, and
>>>> some others could conceivably be made to work on the JVM as well).
>>>
>>> "namespace" and "using" are significantly different from 'package' and
>>> 'import' in semantics.
>>>
>>
>> well, hence the comment "some others could be made to work on the JVM":
>> unlike the differences in class syntax, "namespace" and "using" also
>> differ
>> some in terms of how they work, so would be a little harder to fit
>> onto the
>> JVM as it exists, but could probably be done via a little compiler
>> trickery.
>>
>> the main difference would likely be the potential loss of a 1:1 mapping
>> between source-files and output class files.
>
> You cannot lose what doesn't exist to start with. Source files in the
> usual Java implementation (i.e., one that uses files) have a 1-to-many
> relationship with classes (and therefore with class files in file-based
> implementations). This applies for both nested classes and top-level
> classes. (In a certain very loose sense, an inner class exists
> separately for each instance of its containing class.)
>

fair enough.

what I meant was more like:
you have Java source file in a given path with a given base name;
it is compiled;
it results in a class file in the same path with the same base name 
representing the contained class (except in cases where there may also 
be additional output files).

if the language were using a different structure, then the compiler 
output would more often be in different paths with different names from 
the source files.


>> I am not really intending to argue here about how similar or different
>> "namespace" and "using" are from "package" and "import" though.
>
> There's no room for argument. They are exactly as similar and different
> as they are. The degree of similarity and difference is objectively
> verifiable, as the terms are publicly and transparently defined.
>
> I took exception to your characterization of the differences between
> keywords "namespace" and 'package' and between "using" (the statement,
> not the directive) and 'import' as "likely minor". Definitions of
> "minor" vary, but in my world, "nearly completely different" is not
> minor. (To be fair, the C# "using" directive is rather similar to the
> Java 'import', but the "using" statement is quite different. The "using"
> statement is similar to Java's new try-with-resources.)
>

I was never talking about:
"using(object)" or similar.
yes, this is "almost completely different" from import.


I meant solely the "using", as in:
namespace foo {
	using bar;
	...
}

where, functionally:
package foo;
import bar.*;

is at least vaguely similar to the above (apart from their relations to 
compiler and loader behavior, ...).


> There is no doubt that "namespace" and "using" could be made to work on
> the JVM, for a language that uses those constructs. Java might move in
> the "namespace" direction itself with the proposed module semantics. As
> for "using", I don't see that coming to Java soon, but maybe. It might
> even be part of modules, too; I haven't read up on those yet. (I don't
> see anything recent coming out of this effort.)
>
> <http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html>
>
> <http://openjdk.java.net/projects/modules/>
>

dunno really...

would have to look into it all a bit more to be more certain.
(quick skim of "modules", seems like it is dealing with an altogether 
different problem).


but, there is ActionScript3 which does things like this:
package foo.bar {
	import baz;
	...
}

so, it is sort of like a hybrid...

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-02 10:39 -0400
  Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-02 10:40 -0400
    Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-02 09:41 -0700
      Re: eerie Java-BASIC (partially OT) Roedy Green <see_website@mindprod.com.invalid> - 2012-06-03 00:44 -0700
        Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-03 09:18 -0400
      Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-03 09:15 -0400
        Re: eerie Java-BASIC (partially OT) BGB <cr88192@hotmail.com> - 2012-06-03 13:50 -0500
        Re: eerie Java-BASIC (partially OT) Gene Wirchenko <genew@ocis.net> - 2012-06-03 19:29 -0700
          Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-16 23:35 -0400
            Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-16 23:29 -0700
              Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-17 18:33 -0400
  Re: eerie Java-BASIC (partially OT) BGB <cr88192@hotmail.com> - 2012-06-03 13:26 -0500
    Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-03 12:13 -0700
      Re: eerie Java-BASIC (partially OT) BGB <cr88192@hotmail.com> - 2012-06-03 15:42 -0500
        Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-03 14:23 -0700
          Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-03 14:25 -0700
          Re: eerie Java-BASIC (partially OT) BGB <cr88192@hotmail.com> - 2012-06-05 09:22 -0500
            Re: eerie Java-BASIC (partially OT) Lew <lewbloch@gmail.com> - 2012-06-05 09:54 -0700
      Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-16 23:34 -0400
        Re: eerie Java-BASIC (partially OT) "Mike Schilling" <mscottschilling@hotmail.com> - 2012-06-24 17:02 -0700
          Re: eerie Java-BASIC (partially OT) Lew <noone@lewscanon.com> - 2012-06-24 23:09 -0700
    Re: eerie Java-BASIC (partially OT) Arne Vajhøj <arne@vajhoej.dk> - 2012-06-16 23:30 -0400

csiph-web