Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Did You know that it works? fn = ({a, b}) ->
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alexey Petrushin  
View profile  
 More options Nov 3 2012, 9:42 pm
From: Alexey Petrushin <alexey.petrus...@gmail.com>
Date: Sat, 3 Nov 2012 18:42:00 -0700 (PDT)
Subject: Did You know that it works? fn = ({a, b}) ->

I just today discovered that such statements work

    fn = ({a, b}) ->

even this works

    fn = (a, {b, c}...) ->

It's useful in cases when function accepts options as an argument, I
believe it should be mentioned in docs.

By the way it also works in loops

    console.log(a, b) for {a, b} in list


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Hahn  
View profile  
 More options Nov 3 2012, 10:24 pm
From: Mark Hahn <m...@hahnca.com>
Date: Sat, 3 Nov 2012 19:24:10 -0700
Local: Sat, Nov 3 2012 10:24 pm
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

Thanks.  I write things like the code below all the time.

    fn = opts) ->
        {a, b} = opts

I've found a lot of cool things not in the docs.  I'm waiting for the day
when someone writes a book on CS.  I wonder what animal CS would be.

On Sat, Nov 3, 2012 at 6:42 PM, Alexey Petrushin <alexey.petrus...@gmail.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Wawrusch  
View profile  
 More options Nov 3 2012, 11:09 pm
From: Martin Wawrusch <mar...@wawrusch.com>
Date: Sat, 3 Nov 2012 20:09:10 -0700
Local: Sat, Nov 3 2012 11:09 pm
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

Maybe, Mark, that someone should be you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Demian Ferreiro  
View profile  
 More options Nov 4 2012, 12:08 am
From: Demian Ferreiro <epidem...@gmail.com>
Date: Sun, 4 Nov 2012 01:07:50 -0300
Local: Sun, Nov 4 2012 12:07 am
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

Yeap, the section on d
<http://coffeescript.org/#destructuring>estructuring<http://coffeescript.org/#destructuring>in
the documentation has some interesting examples, but
doesn't mention that destructuring also work on parameters.

On Sat, Nov 3, 2012 at 11:24 PM, Mark Hahn <m...@hahnca.com> wrote:
> I've found a lot of cool things not in the docs.  I'm waiting for the day
> when someone writes a book on CS.  I wonder what animal CS would be.

About a book on CS, when i started digging around CS i read Smooth
C<http://autotelicum.github.com/Smooth-CoffeeScript/>
offeeScript <http://autotelicum.github.com/Smooth-CoffeeScript/>, which i
though was quite good back then. It has some interesting examples of using
CS with different programming paradigms. The animal CS would be, it seems,
is an ostrich =P

On Sat, Nov 3, 2012 at 10:42 PM, Alexey Petrushin <

--
Demian Ferreiro

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Hahn  
View profile  
 More options Nov 4 2012, 2:54 pm
From: Mark Hahn <m...@hahnca.com>
Date: Sun, 4 Nov 2012 11:54:51 -0800
Local: Sun, Nov 4 2012 2:54 pm
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

> Maybe, Mark, that someone should be you.

Thanks for the flattery, but I don't know if I am up to the task.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Lee  
View profile  
 More options Nov 7 2012, 7:44 pm
From: Patrick Lee <patrick.b....@gmail.com>
Date: Wed, 7 Nov 2012 16:44:10 -0800 (PST)
Local: Wed, Nov 7 2012 7:44 pm
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

For what it's worth, the Manning book "CoffeeScript in Action" has
parameter destructuring in chapter 7.

I know this, because I'm writing it.

Expect it in print next year.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Owen Densmore  
View profile  
 More options Nov 30 2012, 12:10 am
From: Owen Densmore <o...@backspaces.net>
Date: Thu, 29 Nov 2012 21:10:36 -0800 (PST)
Local: Fri, Nov 30 2012 12:10 am
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

Also in Trevor Burnham's CoffeeScript book.

BTW: THANKS to all you authors .. making it easy for us!

   -- Owen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Hahn  
View profile  
 More options Nov 30 2012, 1:29 am
From: Mark Hahn <m...@hahnca.com>
Date: Thu, 29 Nov 2012 22:29:15 -0800
Local: Fri, Nov 30 2012 1:29 am
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

> Also in Trevor Burnham's CoffeeScript book.

That's weird. I've read the book and didn't know this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Owen Densmore  
View profile  
 More options Nov 30 2012, 11:24 am
From: Owen Densmore <o...@backspaces.net>
Date: Fri, 30 Nov 2012 09:24:10 -0700
Local: Fri, Nov 30 2012 11:24 am
Subject: Re: [coffeescript] Did You know that it works? fn = ({a, b}) ->

I've got the digital copy so could search for it!  I recalled seeing it in
the introductory material.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »