473,395 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Javascript is turning into Python?!

I hadn't seem this before. New Javascript 1.7 features:

- Generators
- Iterators
- Array comprehensions
- Destructuring assignment

Sounds like another language we know.

http://developer.mozilla.org/en/docs...JavaScript_1.7
Nov 3 '06 #1
7 1205
Paul Rubin wrote:
I hadn't seem this before. New Javascript 1.7 features:

- Generators
- Iterators
- Array comprehensions
- Destructuring assignment

Sounds like another language we know.

http://developer.mozilla.org/en/docs...JavaScript_1.7
Indeed, this is a consequence of Greenspun's tenth rule, and it's good.
It doesn't have much to do with GNU Emacs though.

Nov 3 '06 #2
Paul Rubin wrote:
I hadn't seem this before. New Javascript 1.7 features:

- Generators
- Iterators
- Array comprehensions
- Destructuring assignment

Sounds like another language we know.

http://developer.mozilla.org/en/docs...JavaScript_1.7
Maybe in exchange, Python can borrow the let statement.
Carl Banks

Nov 3 '06 #3
"Carl Banks" <pa************@gmail.comwrites:
http://developer.mozilla.org/en/docs...JavaScript_1.7
Maybe in exchange, Python can borrow the let statement.
Maybe the with statement could be extended to allow binding more than
one variable.
with x as f(), y as g():
blah (x, y)
Nov 3 '06 #4
Paul Rubin wrote:
"Carl Banks" <pa************@gmail.comwrites:
>>>http://developer.mozilla.org/en/docs...JavaScript_1.7

Maybe in exchange, Python can borrow the let statement.


Maybe the with statement could be extended to allow binding more than
one variable.
with x as f(), y as g():
blah (x, y)
Wouldn't that be

with f() as x, g() as y:
blah(x, y)

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Nov 4 '06 #5

Paul Rubin wrote:
"Carl Banks" <pa************@gmail.comwrites:
http://developer.mozilla.org/en/docs...JavaScript_1.7
Maybe in exchange, Python can borrow the let statement.

Maybe the with statement could be extended to allow binding more than
one variable.
with x as f(), y as g():
blah (x, y)
from contextlib import nested

with nested(f(), g()) as (x, y):
....

-Mike

Nov 4 '06 #6
Steve Holden <st***@holdenweb.comwrites:
Wouldn't that be

with f() as x, g() as y:
blah(x, y)
Probably. I haven't started using 2.5 yet.
Nov 4 '06 #7
Steve Holden wrote:
Wouldn't that be

with f() as x, g() as y:
blah(x, y)
or

with f(), g() as x, y:
pass

see guido's comment at the bottom of this page:

http://effbot.org/pyref/with.htm

</F>

Nov 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: willl69 | last post by:
Hi, I was wondering if anyone knows of a way to test if javascript is on with PHP or any other language. I need to test if it is enabled and if it isnt, redirect to another page. Any help...
4
by: Andrew Clark | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** hello, i am trying to create a login page to my website. there are the usual fields for name and password, but i want 2 more: a...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
7
by: Jukka K. Korpela | last post by:
It occurred to me that it seems to be fairly easy to make visually strong elements turn into normal elements or disappear. The need for such effects arises when we wish to do everything possible to...
5
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS...
5
by: Dominic Myers | last post by:
Hi there, I'm developing a site http://camshag.co.uk/art_architecture/ and I'm having a problem with the menu system at the top of the page (The News & Events one). There are two links that should...
7
by: Kirk McDonald | last post by:
Let's say I have a function that takes a callback function as a parameter, and uses it to describe an iteration: def func(callback): for i in : callback(i) For the sake of argument, assume...
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
5
by: Peter Michaux | last post by:
Hi, I might be turning a corner today and seeing the light. I might still be confused :) If JavaScript is the language for the browser then why do servers use Ruby/Rails, Perl/Catalyst,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.