Le 31/10/2011 07:20, Brendan Eich a écrit :
> On Oct 30, 2011, at 11:11 PM, Brendan Eich wrote:
>
>> It ain't 'create' except in a vacuous sense that's also already "taken" by 
>> ES5 Object.create. It isn't "subsuming" in my view. "refinedBy" is closer 
>> but you'll get camelCaps keywords into JS over my dead body!
>>
>> I landed on 'beget' because 'create' is close but vague yet poisoned, and we 
>> need something pithy. Doug already employed it ages ago. Is there a reason 
>> you don't like 'beget'?
> Also, 'beget' does match the "sire" or "hatch" connotation of taking a parent 
> (Self again) object and differentialy inheriting another object from it via 
> proto-linking. Clone means make a twin and mutate. Copy is, well, just a copy 
> -- arguably close to clone and one char shorter (so Self chose well). What we 
> have with <| is more like "generate a child" -- hence, 'beget'.
Asking Google for "beget":
---
Verb:
    (typically of a man, sometimes of a man and a woman) Bring (a child)
into existence by the process of reproduction.
    Give rise to; bring about.

Synonyms:   
generate - breed - procreate - engender - father
---
It sounds indeed very much what you mean. I had to look up, because I,
as a non-native English speaker had never come across the word "beget".
I had seen some JS libraries which used that word (which I thought was
specific to the library).
I think it would be interested to know what other non-native English
speaker think of beget. While operators like "typeof" or "instanceof"
have a pretty straightforward meaning, "beget" sounds more difficult to
grasp for non-native speakers, even those who are familiar with
programming (I had decent experience in C, C++, Java and Lisp before
starting with JavaScript).

"beget" sounds very much like what we want, but I just wanted to raise a
point about understanding and adoption, especially for the language of
the web.

Allen:
> my original suggest is that <| should be produced "prototype for"
What about 'protofor'?
        let obj = base protofor {a: 1, b: 2}
        let arr = base protofor [p, q, r]
        let fun = base protofor function (...args) { ... }
        let re  = base protofor /(\w+)\s+(\w)+/g

Once again, for the specific case of functions, the proto operator has a
semantics that goes way beyond setting the [[prototype]] internal
property. Maybe 'protofor' for the [[prototype]] and 'beget' for the
constructor-related semantics?

David
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to