Re: local

2008-08-21 Thread Breton Slivka
On Fri, Aug 22, 2008 at 1:21 AM, Peter Michaux [EMAIL PROTECTED] wrote: On Thu, Aug 21, 2008 at 6:31 AM, Brendan Eich [EMAIL PROTECTED] wrote: More helpful would be comments on the utility of let blocks (a.k.a. let statements) and let expressions. Also comparisons to the several let forms in

Re: Sugar

2008-08-31 Thread Breton Slivka
One reason I brought them up now was that Java-style classes were discussed. Significant parts of this class functionality could instead be offered by third-party library vendors using these keywords. We'd get more variation, greater freedom, and much faster adaptability, than if it's defined

Re: Date literals

2008-11-19 Thread Breton Slivka
On Thu, Nov 20, 2008 at 9:40 AM, David-Sarah Hopwood [EMAIL PROTECTED] wrote: Peter Michaux wrote: All the data types in ES3 listed in section 15 have literals version (e.g. {} for Object, [] for Array etc) except for Date. Is there any reason that the Kona 15.9.1.15 Date Time string format

Re: Allen's lambda syntax proposal

2008-11-29 Thread Breton Slivka
Hey, I like that. In the spirit of fun, here's something that does something weird and random. var fsm = { r: {|| Math.random()0.5}, f: {|a| print(a); ( fsm.r() ? fsm.s : fsm.r() ? fsm.m : {||} )(f);}, s: {|a| print(a); ( fsm.r() ? fsm.m : fsm.r() ? fsm.f : {||} )(s) },

Re: Allen's lambda syntax proposal

2008-12-01 Thread Breton Slivka
Question: How would I write a recursive function with that syntax? Is there a way to name the lambda, other than var = {||}; ? ___ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: RE: Allen's lambda syntax proposal

2008-12-01 Thread Breton Slivka
Is recursion still desirable in this form. If so, then of the three I like \(a,b,c) {} because you can think of the \ as being an abbreviation of function. \ name(a,b,c) {} Just don't start your function name with u. well if we're thinking about lambdas as blocks++, then why not

Re: Allen's lambda syntax proposal

2008-12-03 Thread Breton Slivka
On Thu, Dec 4, 2008 at 9:28 AM, Michael [EMAIL PROTECTED] wrote: This may be a stupid question, but is the current let expression syntax defined in JavaScript 1.7 too fundamentally different from the sought out lambda expression to be repurposed? Or would this wreak havoc on current uses? I

Re: Allen's lambda syntax proposal

2008-12-04 Thread Breton Slivka
On Fri, Dec 5, 2008 at 9:35 AM, Brendan Eich [EMAIL PROTECTED] wrote: On Dec 4, 2008, at 2:31 PM, Breton Slivka wrote: I admit this seems ludicrous at its face, but admittedly I have not really seen the arguments against λ as an abbreviated lambda syntax yet. Not compatibly: ES3 already

Re: Allen's lambda syntax proposal

2008-12-04 Thread Breton Slivka
On Fri, Dec 5, 2008 at 1:10 PM, Brendan Eich [EMAIL PROTECTED] wrote: I thought this might be the answer. It's clearly too much to ask of all lambda-coders and would-be lambda-coders in the world. My two cents, perhaps I'm wrong and the Schemers and others will switch their kbd configs. Or

Re: Semantics and abstract syntax of lambdas

2008-12-18 Thread Breton Slivka
Okay, is it possible to introduce lambdas with no new syntax at all? possibility 1: for instance, suppose that we have a function that doesn't use arguments or this. Can the implementation statically analyze a function to determine whether a function uses those, and if it does not, optimise it?

Re: Can an Array have array indexed accessor properties and other curiosities??

2009-02-13 Thread Breton Slivka
1) It's disallowed, Array instances can't have own accessor properties with array index names. (and since Array.prototype is an Array instance it can't either. An array instance could only inherit an accessor property with an array index name from Object.prototype) (snip) My preference is

Re: parseInt and implicit octal constants

2009-02-22 Thread Breton Slivka
On Mon, Feb 23, 2009 at 10:13 AM, Garrett Smith dhtmlkitc...@gmail.com wrote: On Sun, Feb 22, 2009 at 9:30 AM, Allen Wirfs-Brock allen.wirfs-br...@microsoft.com wrote: David-Sarah Hopwood wrote: Herman Venter wrote: Finally, there is another approach to resolving this issue. Define a new

Re: Object.prototype.inspect ?

2009-03-12 Thread Breton Slivka
On Fri, Mar 13, 2009 at 11:14 AM, P T Withington p...@pobox.com wrote: snip function subclass () { this.constructor = arguments.callee; } I don't want to smash mysub.prototype.constructor, because that is how I implement 'super': constructor.prototype.constructor. I don't think we can change

Re: Why decimal?

2009-06-24 Thread Breton Slivka
People generally expect math to work how they've been taught in school. When javascript violates their expectations, that is the very definition of a bug. It is true that binary might be more precise for certain kinds of applications, and if it's a native machine type there's performance

Re: arguments.callee in Harmony

2009-09-24 Thread Breton Slivka
On Fri, Sep 25, 2009 at 9:26 AM, Brendan Eich bren...@mozilla.com wrote: On Sep 24, 2009, at 4:06 PM, Charles Jolley wrote: I'm curious, why not just give anonymous functions a default name like callee.  Or perhaps have callee defined in a function scope to represent the function?  That seems

Re: arguments.callee in Harmony

2009-09-24 Thread Breton Slivka
x On Fri, Sep 25, 2009 at 9:31 AM, Yehuda Katz wyc...@gmail.com wrote: What I'd like to know is what the rationale for removing arguments.callee from strict mode is. Is it a performance problem? If so, have implementors tried other solutions at compile-time before agitating for the removal of

Re: arguments.callee in Harmony

2009-09-24 Thread Breton Slivka
On Fri, Sep 25, 2009 at 10:49 AM, Breton Slivka z...@zenpsycho.com wrote: x On Fri, Sep 25, 2009 at 9:31 AM, Yehuda Katz wyc...@gmail.com wrote: What I'd like to know is what the rationale for removing arguments.callee from strict mode is. Is it a performance problem? If so, have

Re: array like objects

2009-12-07 Thread Breton Slivka
The one that I use is function isArrayLike(i){ return (typeof i !==string) i.length !== void (0); } It might not be perfect, but it allows me to make certain assumptions about the input that are useful enough. Keep in mind that an Array may have a length of 5, and all those values are

Re: array like objects

2009-12-07 Thread Breton Slivka
On Tue, Dec 8, 2009 at 1:29 PM, Breton Slivka z...@zenpsycho.com wrote: The one that I use is function isArrayLike(i){ return (typeof i !==string) i.length !== void (0); } It might not be perfect, but it allows me to make certain assumptions about the input that are useful enough. Keep

Re: AST in JSON format

2009-12-07 Thread Breton Slivka
On Tue, Dec 8, 2009 at 3:57 PM, David-Sarah Hopwood david-sa...@jacaranda.org wrote: snip That would however depend on an assessment of whether browser implementors had succeeded in implementing secure and correct ES5-AST parsers (with a mode that accepts exactly ES5 as specified, not ES5 plus

Re: array like objects

2009-12-14 Thread Breton Slivka
On Tue, Dec 15, 2009 at 6:29 AM, Mike Samuel mikesam...@gmail.com wrote: (3) If (!1), should future EcmaScript drafts define iteration order for arrays as index order and possibly recommend to array like host objects that the define iteration order similarly. I would suggest that this change

Re: array like objects

2009-12-14 Thread Breton Slivka
On Tue, Dec 15, 2009 at 10:34 AM, Mike Samuel mikesam...@gmail.com wrote: 2009/12/14 Breton Slivka z...@zenpsycho.com: On Tue, Dec 15, 2009 at 6:29 AM, Mike Samuel mikesam...@gmail.com wrote: (3) If (!1), should future EcmaScript drafts define iteration order for arrays as index order

Re: natively negotiating sync vs. async...without callbacks

2010-12-07 Thread Breton Slivka
On Wed, Dec 8, 2010 at 8:48 AM, Getify Solutions get...@gmail.com wrote: I am aware that I'm kicking a potentially angry beehive by bringing up this topic, but I wanted to just have some discussion around if there's any possibility that JavaScript can, in the near term, have a native mechanism

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Breton Slivka
I can't think of a single way to simulate setTimeout in ES5. Correct me if I'm wrong, but I don't think ES5 exposes a single way of defining a mechanism like: -- var x = 4; function f(){ x = 5; print(x); } timer(f, 1); print(f); -- Such that it would output 4 before 5. That's what I

Re: Bringing setTimeout to ECMAScript

2011-03-19 Thread Breton Slivka
never write code on no sleep. that code sample should be : timers= (function () { var timers = []; var id=0; timer=function (f,t) { timers.push({func:f, interval:t, id:id++}); return id; } return timers; }) runScript(env.js);

Re: Re: Object.prototype.* writable?

2011-05-07 Thread Breton Slivka
whoah! I didn't know that. Why doesn't that work with: function o () {}; o.prototype=null; new o(); ? As for the current discussion, I should think that some way to instantiate a new clean global object, and inject it into the current scope would be somewhat more useful, as it would enable

Re: statements that could be expressions?

2011-06-04 Thread Breton Slivka
If I could demonstrate my idea working in Narcissus (or your parser of choice), would that be helpful or useful to anyone? I was thinking about the ambiguity of {x,y} with relation to the key/value shortcut, and it seems that there's a lot of ambiguities around the { symbol that are causing some

Re: Classes: suggestions for improvement

2011-06-14 Thread Breton Slivka
Perhaps I am overlooking something obvious, but is there something wrong with calling a constructor function `constructor`, rather than class or proto or prototype? ___ es-discuss mailing list es-discuss@mozilla.org

Re: Unifying Block and ObjectLiteral (was: Re: block-lambda revival)

2011-06-28 Thread Breton Slivka
hereby relinquish all copyright, trademark and patent rights I may possibly hold, to the idea of unifying the object literal and block grammar constructions to the TC39 group and its constituent members, so help me god. -Breton Slivka On Wednesday, June 29, 2011, Brendan Eich bren...@mozilla.com wrote