Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28607
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Newsgroups | comp.lang.javascript, comp.lang.java.programmer |
| Subject | Re: questions re Javascript |
| Date | 2015-09-03 01:45 +0200 |
| Organization | solani.org |
| Message-ID | <ms81n8$tlh$1@solani.org> (permalink) |
| References | <2b531f48-fff9-4c73-a116-22a3f110e919@googlegroups.com> <020920150828500988%timstreater@greenbee.net> <java-and-javascript-20150902121750@ram.dialup.fu-berlin.de> <ms7u1o$guu$1@solani.org> <closures-20150903000011@ram.dialup.fu-berlin.de> |
Cross-posted to 2 groups.
Stefan Ram wrote:
> "Christoph M. Becker" <cmbecker69@arcor.de> writes:
>> Does that really work in Java? Most certainly the following won't:
>> int x = 2;
>> String y = "x";
>> x + y;
>
> Not exactly in this wording, but essentially:
>
> public final class Main
> { public static void main( final java.lang.String[] args )
> { final int x = 2;
> final java.lang.String y = "x";
> java.lang.System.out.println( x + y ); }} /* prints:
> 2x */
Interesting, thanks! Nonetheless this seems to be rather a particular
convenience regarding "constants", and not a general flexibility of the
type system.
>> versions of JavaScript and Java were *very* different. Early versions
>> of Java didn't even have closures (a basic building block of all but the
>
> One must not confuse the syntactic feature of function literals
> (called »lambdas«) with the semantic feature of entities that
> »close over« (contain) local environments (called »closures«).
Thanks for the clarification.
> (Possibly, the first versions of LISP had lambdas, but not
> closures, too, then closures were invented to solve the
> »outward funarg problem« IIRC.)
IIRC, early versions of LISP where dynamically scoped (a concept I still
can't really grasp, and what unfortunately is reflected by `this` in
ECMAScript), whereas only later versions (most notably Common Lisp and
Scheme) defaulted to lexical scoping (which is much more intuitive to me).
Anyhow, I still think that Java has its main roots in C++, and
JavaScript in Scheme, and as such I'd categorize Java as
object-oriented, but JavaScript as functional (actually, applicative)
programming language (the lines are blurred, and are becomming more
blurred as time goes by, though).
PS: I'm aware of Guy L. Steele's influence on Scheme, Common Lisp *and*
Java.
--
Christoph M. Becker
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
questions re Javascript rdelaney2001@gmail.com - 2015-09-01 15:34 -0700
Re: questions re Javascript mentificium@gmail.com - 2015-09-01 15:58 -0700
Re: questions re Javascript Tim Streater <timstreater@greenbee.net> - 2015-09-02 08:28 +0100
Re: questions re Javascript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-09-03 00:43 +0200
Re: questions re Javascript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-09-03 01:45 +0200
Re: questions re Javascript Arne Vajhøj <arne@vajhoej.dk> - 2015-09-03 19:57 -0400
Re: questions re Javascript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-09-04 02:37 +0200
Re: questions re Javascript Arne Vajhøj <arne@vajhoej.dk> - 2015-09-03 20:01 -0400
Re: questions re Javascript Martin Gregorie <martin@address-in-sig.invalid> - 2015-09-04 08:46 +0000
Re: questions re Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-05 09:35 +0200
Re: questions re Javascript Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2015-09-04 10:09 -0500
Re: questions re Javascript Tim Streater <timstreater@greenbee.net> - 2015-09-04 16:37 +0100
Re: questions re Javascript Tim Streater <timstreater@greenbee.net> - 2015-09-04 22:51 +0100
Re: questions re Javascript Eternal Hope <laughingspam99@gmail.com> - 2015-09-05 20:29 +0100
Re: questions re Javascript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-04 18:17 +0200
Re: questions re Javascript Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 19:40 -0400
Re: questions re Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-05 09:47 +0200
Re: questions re Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-05 22:16 +0200
Re: questions re Javascript Luuk <luuk@invalid.lan> - 2015-09-05 14:14 +0200
Re: questions re Javascript Jay Braun <lyngwyst@gmail.com> - 2015-09-02 14:42 -0700
Re: questions re Javascript Chuck Anderson <seemysig@thisis.invalid> - 2015-09-05 03:22 -0600
csiph-web