Sugar unrelated to macros -- Was: Re: Sugar

Ingvar von Schoultz ingvar-v-s at comhem.se
Thu Aug 28 18:39:51 PDT 2008


Brendan Eich wrote:
> On Aug 28, 2008, at 3:26 PM, Ingvar von Schoultz wrote:
> 
>> Macros and functions are very, very different. My proposal
>> has only regular, run-of-the-mill functions. They don't have
> 
> "do have", right?

No, they don't have parentheses:

      use sugar frozen, Constructor, inherits;
      ...
      frozen Constructor Child (...)
      inherits new Parent (...)
      {   ...
      }

This desugars to:

      const Child = Constructor
      (   frozen(),
          function Child (...)
          {   ...
          },
          inherits (new Parent (...))
      );

All the sugar-keyword functions are user defined. The desugaring
above is simplified. The functions frozen() and inherits() return
objects that Constructor() recognizes and acts on.

This sugar is not only useful for creating classes and constructors,
it's also useful in expressions.

>> parentheses around the arguments, but this detail doesn't
>> make them in any way related to macros and their problems.
> 
> If you mean hygiene, that is not a practical problem so much as a 
> theoretical one. Dave knows a lot about this topic, so I'll defer to him.

You have stated firmly that macros will not be included before
unsolved hygiene problems have been researched. I'm hoping that
regular functions will be more palatable.

It's a great feature of JavaScript that it accommodates so many
paradigms. With this sugar you'd get clearer syntax for many
different paradigms.

>> I find it disconcerting that this list will so easily brush off
>> proposals with some vague comment about something never proposed.
> 
> Please cut the "this list" collective guilt assignment. Felix 
> <felix8a at gmail.com <mailto:felix8a at gmail.com>> replied identifying your 
> idea with Python decorators, and you did not reply to him. Was his reply 
> either disconcerting or a brush-off? No. Keep your arguments with 
> individuals focused on individuals with whom you have a bone to pick, or 
> better yet, avoid /ad hominem/ (/ad listinem/ ;-) arguments altogether.

Uff, I'm sorry, I shouldn't have said it that way.

I was thinking back to the hoisting proposal, which was brushed off
over and over with vague talk about things I had never proposed,
never discussing my real proposal. But this was in part my own fault
for being so verbose (though I thought I wasn't clear enough, and
needed to explain /more/... a vicious circle).

But indeed I shouldn't have said it that way above. Sorry.

Felix's reply was certainly not a brush-off, very much the contrary.
I appreciated it. I wanted to answer, but couldn't think of anything
interesting to add to what he said.

-- 
Ingvar von Schoultz



More information about the Es-discuss mailing list