Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26180
| From | Ken Wesson <kwesson@gmail.com> |
|---|---|
| Subject | Re: Java vs C++ |
| Newsgroups | comp.lang.java.programmer |
| References | (2 earlier) <4d4d60dc$0$23763$14726298@news.sunsite.dk> <4d4d8322$0$41117$e4fe514c@news.xs4all.nl> <iil53i$q34$1@lust.ihug.co.nz> <iil5ed$10m$1@news.eternal-september.org> <iimf47$soo$1@news.belwue.de> |
| Message-ID | <4d4f69fa@news.x-privat.org> (permalink) |
| Date | 2011-02-07 04:41 +0100 |
| Organization | X-Privat.Org NNTP Server - http://www.x-privat.org |
On Sun, 06 Feb 2011 16:35:32 +0100, Thomas Richter wrote: > Joshua Cranmer wrote: >> On 02/05/2011 10:38 PM, Lawrence D'Oliveiro wrote: >>> In message<4d4d8322$0$41117$e4fe514c@news.xs4all.nl>, Silvio wrote: >>> >>>> And Lew is correct: templates and genercis are completely different >>>> beasts. >>> >>> “Completely” as in “having nothing in common”? Or is this some usage >>> of “completely” that I wasn’t aware of? >>> >>> Please explain. >> >> Templates in C++ are basically advanced macros--each invocation of a >> template type regenerates the class, so a Foo<int> and a Foo<double> >> are two completely different things. > > That's much more than a macro could do. Templates are a language of its > own, include syntax checks, etc. Quite unlike macros, they do not > substitute text patterns. Templates allow meta-programming, i.e. you can > use the compiler to generate code. And, of course, templates are quite > complex - very unlike the simple-minded preprocessor. I take it by "macros" you mean the simple-minded preprocessor macros of C and C++. Lisp has things it calls "macros" that are much more sophisticated, including syntax checks, etc., and are able to do everything C++ templates can do and then some. Common Lisp macros can generate templated CLOS classes, for instance.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar
Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-06 16:35 +0100
Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:51 +1300
Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 22:06 -0500
Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:01 +1300
Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 16:08 +1300
Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 14:53 +0100
Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 19:52 -0500
Re: Java vs C++ Lew <noone@lewscanon.com> - 2011-02-06 13:09 -0500
Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 00:55 +0100
Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:00 +1300
Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:20 -0500
Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:52 +1300
Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 21:25 -0500
Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:29 -0500
Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 00:57 +0100
Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 12:57 -0500
Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 10:09 -0800
Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 12:07 -0800
Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 15:22 -0500
Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 08:11 -0800
Re: Java vs C++ Ken Wesson <kwesson@gmail.com> - 2011-02-07 04:41 +0100
csiph-web