Proto operator for function declarations (was: Re: <| and function declarations)

# Herby Vojčík (14 years ago)

Hello,

in harmony:proto_operator, these two items appear in rationale:

  • Setting the prototype of a function to something other than Function.prototype
  • Implementing class-like parallel constructor and instance prototype inheritance chains.

These items can be very beneficial for function declarations, but for the moment, the proposal only allows these for function expression:

var Foo = Super <| function (name) { ... };

Could the proposal be extended to allow also declarations, either as:

Super <| function Foo (name) { ... }

or, probably slightly better because declaration would begin with 'function', but harder to set up a grammar:

function Super <| Foo (name) { ... }

?

Thanx,