Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | David Thompson <dave.thompson2@verizon.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: A question for this group... |
| Message-ID | <ns9f08tmapsbhclufoc85f2m3tkjcdod4h@4ax.com> (permalink) |
| References | (5 earlier) <4fec041d$0$1390$4fafbaef@reader2.news.tin.it> <1df54e49-511e-4dc7-bb7a-ed23cf6a7d25@googlegroups.com> <256600e3-2255-44e2-a535-3d29dd9f40e5@googlegroups.com> <slrnjuoika.eq8.fis@iris.zem.fi> <7b19f49a-270c-47a2-af27-99102a3ac314@googlegroups.com> |
| Organization | TeraNews.com |
| Date | 2012-07-19 02:40 -0400 |
On Thu, 28 Jun 2012 13:07:54 -0700 (PDT), Malcolm McLean <malcolm.mclean5@btinternet.com> wrote: > ?????? ??? ?????, 28 ????? 2012 13:14:02 UTC+1, ??? Heikki Kallasjoki: > > On 2012-06-28, Malcolm McLean <malcolm.mclean5@btinternet.com> wrote: > > For example, > > > > System.out.println(java.io.File.separator); > > > > is definitely not guaranteed to produce the same output on all Java > > systems. > > > Presumably that's regarded as a class which is part of the program, > rather than the program itself. If I write two methods called tan(), > one of which performs the mathematical operation whilst another > switches on a machine in a sun parlour, we wouldn't expect linking the > two libraries to have idential results. That's true of almost every > programming language. I'm not sure what 'class which is part of the program, rather than the program itself' is intended to mean. All Java packages with first component java or javax, and classes in them such as java.io.File here, are reserved for definition by Sun^WOracle. System is actually java.lang.System (because java.lang is automatically visible in all Java code, unlike all other packages) and thus similarly standard. Most java.* packages are part of the (JRE) standard library and thus usable from any Java code; since Java is dynamically linked, a complete program can only be defined sensibly as a main routine and everything its execution can -- or more strictly, does -- access. In C and some older compiled languages there is a global namespace for 'external' (in C, non-static) routines and variables, so yes two different 'tan's can be a problem. C++ has namespaces which can be used to disambiguate, but IME people rarely do. Fortran>=90 has one-level modules, but it's not clear to me how much they are used; a lot of Fortran code is 'dusty decks' from long before 1990. Ada and Java have hierarchical package naming, which people do use. The two tan's in your example would actually be something like: org.mathlovers.Trigonometry.tan com.New_You_483.Farrah.tan and Java the full 'path' is in the .class file and used for dynamic linking at runtime to get the correct one. Some languages allow overloads of routines/methods with different parameter lists. Java distinguishes these in the .class file; C++ typically uses mangled linker names (though the standard doesn't specify); Ada usually needs a special or modified linker anyway and can also resolve on expected return type. (Fortran>=90 allows you to user-define generic names which call different routines depending on argument types, but those 'specific' routines do have unique names -- although possibly 'private' ones you can't directly use in a call.) So java.io.File.separator is always, on every valid JVM, a specific Suncle-defined variable with a platform-dependent value which is in fact different on different JVMs, falsifying your overbroad claim. What *is* standard across all platforms in Java is the core language -- e.g. int arithmetic is 32-bit 2's-complement with wraparound -- except as you said (almost) floating-point in the absence of strictfp; and a large fraction of the standard library (up to resource limits, and there Java is at least safe, unlike some C implementations). Java also has a fair chunk of library functionality altered by locale (e.g. character encoding, date-time format) or timezone; so does C (and C++). This is a grey area that makes 'strictly conforming' even more useless, since it produces different results even on machines of the same type or users on the same machine, which are intended to be and usually(?) are all correct.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A question for this group... gazelle@shell.xmission.com (Kenny McCormack) - 2012-05-15 17:41 +0000
Re: A question for this group... "Chine Bleu, Russie Blanche, et Khmer Rouge" <chine.bleu@yahoo.com> - 2012-05-15 10:44 -0700
Re: A question for this group... James Kuyper <jameskuyper@verizon.net> - 2012-05-15 14:06 -0400
Re: A question for this group... William Ahern <william@wilbur.25thandClement.com> - 2012-05-15 13:24 -0700
Re: A question for this group... Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2012-05-15 20:56 +0000
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-05-16 03:41 -0700
Re: A question for this group... Old Wolf <oldwolf@inspire.net.nz> - 2012-05-16 02:31 -0700
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-05-16 03:53 -0700
Re: A question for this group... gazelle@shell.xmission.com (Kenny McCormack) - 2012-05-16 14:08 +0000
Re: A question for this group... Martin Shobe <martin.shobe@yahoo.com> - 2012-05-16 14:49 +0000
Re: A question for this group... Martin Shobe <martin.shobe@yahoo.com> - 2012-05-16 14:59 +0000
Re: A question for this group... Kaz Kylheku <kaz@kylheku.com> - 2012-05-16 16:05 +0000
Re: A question for this group... Old Wolf <oldwolf@inspire.net.nz> - 2012-05-16 14:29 -0700
Re: A question for this group... Stephen Sprunk <stephen@sprunk.org> - 2012-05-16 18:18 -0500
Re: A question for this group... Robert Miles <milesrf@Usenet-News.net> - 2012-06-23 23:22 -0500
Re: A question for this group... Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-25 02:41 -0700
Re: A question for this group... gazelle@shell.xmission.com (Kenny McCormack) - 2012-06-25 16:29 +0000
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-06-26 08:27 -0700
Re: A question for this group... gazelle@shell.xmission.com (Kenny McCormack) - 2012-06-27 09:05 +0000
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-06-27 03:57 -0700
Re: A question for this group... Neil Cerutti <neilc@norwich.edu> - 2012-06-27 13:49 +0000
Re: A question for this group... "io_x" <a@b.c.invalid> - 2012-06-28 09:19 +0200
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-06-28 01:59 -0700
Re: A question for this group... Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-28 04:18 -0700
Re: A question for this group... Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-06-28 12:14 +0000
Re: A question for this group... James Kuyper <jameskuyper@verizon.net> - 2012-06-28 08:28 -0400
Re: A question for this group... James Kuyper <jameskuyper@verizon.net> - 2012-06-28 08:33 -0400
Re: A question for this group... Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-06-28 13:07 -0700
Re: A question for this group... David Thompson <dave.thompson2@verizon.net> - 2012-07-19 02:40 -0400
Re: A question for this group... "io_x" <a@b.c.invalid> - 2012-06-28 18:58 +0200
Re: A question for this group... Andrew Cooper <amc96@cam.ac.uk> - 2012-06-29 01:11 +0100
Re: A question for this group... Philip Lantz <prl@canterey.us> - 2012-07-05 00:21 -0700
Re: A question for this group... nick_keighley_nospam@hotmail.com - 2012-07-06 00:24 -0700
Re: A question for this group... Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-06 17:43 -0700
csiph-web