Re: Enforcing return value types

2007-11-12 Thread Lars T Hansen
I'm guessing you're just experiencing the effects of http://bugs.ecmascript.org/ticket/285. The correct behavior is a run-time error in standard mode; compile-time error in strict mode. --lars On Nov 12, 2007 11:38 PM, Nathan de Vries <[EMAIL PROTECTED]> wrote: > Hi everyone, > > What's the exp

Enforcing return value types

2007-11-12 Thread Nathan de Vries
Hi everyone, What's the expected behaviour for a function returning a value, of which the type is contrary to the type defined in the function declaration? For example: var func:Function = function():int { return "This is not an int"; } typeof(func()); // string Is this exp

Re: roundTiesToEven

2007-11-12 Thread Graydon Hoare
Graydon Hoare wrote: >- You can actually represent 0.5 in the first place! Binary floating > point cannot. Decimal can. In the default decimal context, 0.5 + 0.5 > gives an exact decimal answer; there is no rounding to worry about. Oops, excuse me: 0.1. As I've had pointed out, 0.5

Re: roundTiesToEven

2007-11-12 Thread Graydon Hoare
Jonathan Watt wrote: > liorean wrote: >> On 11/11/2007, Jonathan Watt <[EMAIL PROTECTED]> wrote: >>> I've noticed that rounding in the reference implementation is implemented >>> using >>> IEEE roundTiesToEven, but in browsers .5 values appear to round towards >>> zero. >>> Although roundTiesToEv

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 5:19 PM, Lars T Hansen wrote: > IMO the only sane thing to do in this regard, if we were to do > anything, is to add what we consider bug-fixing behavior to the > effects of "use strict". We've already hung the eval change there, For good reason too -- if eval can create bind

Re: Assigning to ReadOnly properties

2007-11-12 Thread Lars T Hansen
On Nov 12, 2007 4:25 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Nov 12, 2007, at 4:01 PM, Mark Miller wrote: > > > To fix delete within this constraint, "delete " in Caja > > either return true or throws. > > At this point, either ES4 slides down the slippery slope a bit and > courts migratio

Bringing up the issue of numerical constraints again

2007-11-12 Thread liorean
Hello! Since we now have a namespace for uint specific math operations, and discussion in another thread about using pragmas for throwing if assigning to ReadOnly properties... Is it possible we could have a look at the idea of adding constrained primitive types or adding a pragma changing the mec

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 4:01 PM, Mark Miller wrote: > To fix delete within this constraint, "delete " in Caja > either return true or throws. At this point, either ES4 slides down the slippery slope a bit and courts migration pain that holds it back (we really do expect most pages on the web toda

Re: need some clarification on compile-time type vs. run-time type

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 3:58 PM, Brendan Eich wrote: >> There are couple potential problems with upgrading |instanceof| to >> match the syntax of the revised |is|: >> >> 1) Function expr syntax ambiguity. Consider: >> >> a) x is function(p: int): int // ok >> b) x is function(p: int): int {} // syntax

Re: Assigning to ReadOnly properties

2007-11-12 Thread Mark Miller
On Nov 12, 2007 2:30 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > Nothing as badly silent as assigning to a ReadOnly property, but here I'll > bitch about a similar change during ES1 standardization: delete x => false > > Anyway, with exception handling these both seem like warts. At least with >

Re: need some clarification on compile-time type vs. run-time type

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 1:40 PM, YR Chen wrote: > Definitely like it. I wonder how convoluted the grammar change was > - did it require a new value_expr_no_conflicts_with_type_expr > production and all related productions/rules? Not sure, but top-down parsers have it easy, discriminating on the

Re: Is there a design rationale document?

2007-11-12 Thread ungar
Many thanks. If there is any way I can be of any help, please don't hesitate to ask. I would be delighted. - David On Nov 12, 2007, at 3:02 PM, Jeff Dyer wrote: > > On 11/12/07 2:17 PM, [EMAIL PROTECTED] wrote: > >> Hello all, >> >> Thank you for adding me to this list. >> >> I have just fini

Re: Searching the mailing list archives

2007-11-12 Thread Chris Pine
Jonathan Watt wrote: > It would be really nice to be able to search the mailing list archives. Use Google: site:https://mail.mozilla.org/pipermail/es4-discuss/ closure Chris ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.

Re: Is ES3 good enough? Was incrementally strengthening ES3 paradigms considered?

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 1:56 PM, YR Chen wrote: > Personally, I'm still mixed on the introduction of the whole > nominal type system with classes and whatnot. I'm very sympathetic > to views that ES4 should concentrate on ES3's weak points. At > times, I feel that ES3 is just too "alien" a base

Re: Assigning to ReadOnly properties

2007-11-12 Thread T. Michael Keesey
On Nov 12, 2007 2:50 PM, Jonathan Watt <[EMAIL PROTECTED]> wrote: > > > > Actually, no, I guess there's "use xml namespace [string or Namespace > > object]", which might suggest "use error [Class reference or object]". > > The latter could be used for other types of errors as well. > > use error Re

Re: Is there a design rationale document?

2007-11-12 Thread Jeff Dyer
On 11/12/07 2:17 PM, [EMAIL PROTECTED] wrote: > Hello all, > > Thank you for adding me to this list. > > I have just finished reading the language proposal spec, and was > struck by the richness of the additions to the language. I haven't > been following this effort at all; and so thank people

Re: Assigning to ReadOnly properties

2007-11-12 Thread Jonathan Watt
T. Michael Keesey wrote: > On Nov 12, 2007 2:22 PM, Jonathan Watt <[EMAIL PROTECTED]> wrote: >> I'm not sure what maintaining case convention gives you here. Using |use >> ReadOnlyError| is about as intuitive and easy to remember as it could be I >> think. > > Since the existing pragma directives

Re: Assigning to ReadOnly properties

2007-11-12 Thread T. Michael Keesey
Hi, new here. On Nov 12, 2007 2:22 PM, Jonathan Watt <[EMAIL PROTECTED]> wrote: > > >>>use readonly error > >>> > >>> or perhaps > >>> > >>>use readonly throw > >>> > >>> We try to make pragmas more readable, sometimes with an extra word; > >>> not sure this is the best way to phrase it st

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 1:43 PM, YR Chen wrote: On Nov 12, 2007 11:40 AM, Mark Miller <[EMAIL PROTECTED]> wrote: On Nov 12, 2007 9:05 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > [..], but the idea would > be to enable throwing of a ReadOnlyError on assignment to a ReadOnly > property. Comments? H

Re: Assigning to ReadOnly properties

2007-11-12 Thread Jonathan Watt
Brendan Eich wrote: > On Nov 12, 2007, at 9:34 AM, Jonathan Watt wrote: > >> I like the idea of a pragma more than opt-in versioning since it >> can be used >> in-place, and (I guess) placed before and after a section of code >> to turn the >> handling on then off again. > > Pragmas are block

Is there a design rationale document?

2007-11-12 Thread ungar
Hello all, Thank you for adding me to this list. I have just finished reading the language proposal spec, and was struck by the richness of the additions to the language. I haven't been following this effort at all; and so thank people in advance for their patience with my ignorance. Now th

Re: Is ES3 good enough? Was incrementally strengthening ES3 paradigms considered?

2007-11-12 Thread YR Chen
On Nov 12, 2007 3:56 PM, YR Chen <[EMAIL PROTECTED]> wrote: > I'm very sympathetic to views that ES4 should concentrate on ES3's weak > points. Oops, I meant that strong points, not weak points. ___ Es4-discuss mailing list Es4-discuss@mozilla.org http

Re: Is ES3 good enough? Was incrementally strengthening ES3 paradigms considered?

2007-11-12 Thread YR Chen
Personally, I'm still mixed on the introduction of the whole nominal type system with classes and whatnot. I'm very sympathetic to views that ES4 should concentrate on ES3's weak points. At times, I feel that ES3 is just too "alien" a base to build the "programming in the large" features that ES4 a

Re: Assigning to ReadOnly properties

2007-11-12 Thread YR Chen
On Nov 12, 2007 11:40 AM, Mark Miller <[EMAIL PROTECTED]> wrote: > On Nov 12, 2007 9:05 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > > [..], but the idea would > > be to enable throwing of a ReadOnlyError on assignment to a ReadOnly > > property. Comments? > > Hi Brendan, > > I'm glad to hear tha

Re: need some clarification on compile-time type vs. run-time type

2007-11-12 Thread YR Chen
Responding to 2 emails here... On Nov 12, 2007 12:35 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Nov 11, 2007, at 4:26 PM, Brendan Eich wrote: > > > Part of the thinking in > > resolving #103 in favor of type expression on right of 'is' was to > > future-proof against a world where type and

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 9:40 AM, Mark Miller wrote: > On Nov 12, 2007 9:05 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: >> [..], but the idea would >> be to enable throwing of a ReadOnlyError on assignment to a ReadOnly >> property. Comments? > > Hi Brendan, > > I'm glad to hear that this possibility i

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 9:34 AM, Jonathan Watt wrote: > I like the idea of a pragma more than opt-in versioning since it > can be used > in-place, and (I guess) placed before and after a section of code > to turn the > handling on then off again. Pragmas are block-scoped, so just one should do.

Re: Pragmas

2007-11-12 Thread Peter Hall
On the surface, that sounds like it makes sense. But if I'm writing an application in strict mode, that uses a pre-existing library, will I have to edit that library to add "use standard" to every file? "Inheriting" the pragma is not straightforward unless you inherit only from the program entry p

Re: Pragmas

2007-11-12 Thread Jeff Dyer
Got it. Thanks! Jd On 11/12/07 10:25 AM, Peter Hall wrote: > Also, there is a minor bug [1] with the pragma syntax: > > Pragma : > UsePragma SemicolonFull > ImportPragma SemicolonFull > > UsePragma : > use PragmaItems SemicolonFull > > > resulting in two semicolons being required after

Re: Pragmas

2007-11-12 Thread Peter Hall
Also, there is a minor bug [1] with the pragma syntax: Pragma : UsePragma SemicolonFull ImportPragma SemicolonFull UsePragma : use PragmaItems SemicolonFull resulting in two semicolons being required after a "use" pragma. Peter [1] http://wiki.ecmascript.

Re: Pragmas

2007-11-12 Thread Lars T Hansen
Pragmas are invariably lexically scoped. Some pragmas are probably more useful at the top level, "use strict" is among these. One pattern we think might develop is "use strict" at the top level, followed by "use standard" inside some blocks where strict mode gets in the way (if only temporarily

Pragmas

2007-11-12 Thread Peter Hall
What is the scope of a pragma such as that? Is it just the current lexical scope, like a "use namespace" statement, or does it change the behaviour for the entire program? If it's the latter, isn't there a compatibility problem between libraries? If it's the former, do you anticipate that es4 progr

Re: Assigning to ReadOnly properties

2007-11-12 Thread Mark Miller
On Nov 12, 2007 9:05 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > [..], but the idea would > be to enable throwing of a ReadOnlyError on assignment to a ReadOnly > property. Comments? Hi Brendan, I'm glad to hear that this possibility is in scope. In the Caja spec, we write: \item[Silent erro

Searching the mailing list archives

2007-11-12 Thread Jonathan Watt
It would be really nice to be able to search the mailing list archives. ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Re: Assigning to ReadOnly properties

2007-11-12 Thread Jonathan Watt
Brendan Eich wrote: > On Nov 12, 2007, at 9:00 AM, Jonathan Watt wrote: > >> Hi, >> >> As I understand it the reason assignment to ReadOnly properties >> fails silently >> is that there was no try-catch prior to ECMAScript 3. > > Right. Netscape 2 reported a fatal error, but during ES1 > stan

Re: Assigning to ReadOnly properties

2007-11-12 Thread Brendan Eich
On Nov 12, 2007, at 9:00 AM, Jonathan Watt wrote: > Hi, > > As I understand it the reason assignment to ReadOnly properties > fails silently > is that there was no try-catch prior to ECMAScript 3. Right. Netscape 2 reported a fatal error, but during ES1 standardization we agreed to go with si

Assigning to ReadOnly properties

2007-11-12 Thread Jonathan Watt
Hi, As I understand it the reason assignment to ReadOnly properties fails silently is that there was no try-catch prior to ECMAScript 3. Could/will edition 4 require an exception to be thrown in strict mode? Jonathan ___ Es4-discuss mailing list Es4-dis

Security in ES4 - (OpenAjax)

2007-11-12 Thread Ric Johnson
The OpenAjax Alliance website (OpenAjax.Org) was recently hacked (a phishing attack according to Jon Ferraiolo) and so I have let the group use the domain http://OpenAjax.Com in it's place until everything is worked out. It seems GoDaddy has been very responsive, and the DNS is switched back, and