[TxMt] How can TextMate be so popular???

Michael Jackson mjijackson at gmail.com
Tue Mar 6 21:30:08 UTC 2007


Andy,

It should be:

> function foo () {
> return {
> //     bar: function ( x ) {
>    bar: function ( x, y ) {
>      return x + y;
>    }
> };
> }

NOT

> function foo () {
> return {
> //     bar: function ( x ) {
>    bar: function ( x, y ) {
>      return x + y;
>    },       <-- comma indicates that this key/value pair should be  
> followed by at least one more in this object
> };
> }

Your browser may have parsed it, I dunno. I didn't try it. But with  
an editor that relies on regular expressions to match syntax,  
something as small as this would probably throw it off.



Michael



On Mar 6, 2007, at 2:24 PM, Andy Armstrong wrote:

> On 6 Mar 2007, at 21:21, Michael Jackson wrote:
>> Ha ha...now I KNOW you're an idiot. First, learn javascript. Your  
>> syntax is WRONG.
>
> Actually his syntax is just fine. What did you think was wrong with  
> it?
>
> [18:51] andy $ js
> js>
> js> function foo () {
> return {
> //     bar: function ( x ) {
>    bar: function ( x, y ) {
>      return x + y;
>    },
> };
> }
> js> x = foo()
> [object Object]
> js> x.bar(1, 2)
> 3
>
>
> -- 
> Andy Armstrong, hexten.net
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list