Re: Type Annotations ?

2007-10-03 Thread David Teller
The type annotations I have in mind would be related to side effects.

So, should I go for something like

function write_to_file(f : String /*file_name*/): void /*write f*/ {
  ...
}

?

Cheers,
 David

On Wed, 2007-10-03 at 07:44 -0700, Lars T Hansen wrote:
> The ES4 syntax for type annotations is invariably a postfix ": type"
> phrase: put it on variable bindings, parameters, functions (following
> the parameter list).

-- 
David Teller --
Security of Distributed Systems ---
-- http://www.univ-orleans.fr/lifo/Members/David.Teller
- Laboratoire d'Informatique Fondamentale d'Orleans

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


Re: Type Annotations ?

2007-10-03 Thread Lars T Hansen
The ES4 syntax for type annotations is invariably a postfix ": type"
phrase: put it on variable bindings, parameters, functions (following
the parameter list).

For example,

  function dot( xs: Vector., ys: Vector.): double {
let result: double = 0
for ( let i: uint=0, limit: uint=xs.lenght ; i < limit ; i++ )
  result += xs[i] * ys[i]
return result
  }

There are some subtleties with providing type annotations for names
bound by destructuring bindings; details can be found in the proposals
and are in any case forthcoming in a coherent writeup.

--lars

On 10/3/07, David Teller <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>  I'm still working on my static analysis tool for ES4. This tool will
> make use of custom type (or type-like) annotations. I wonder if there
> are already syntax guidelines for this kind of things. I assume I should
> put them somewhere in comments. Should I use something like Java's
> @annotation tag ?
>
> Thanks,
>  David
>
>
> --
> David Teller --
> Security of Distributed Systems ---
> -- http://www.univ-orleans.fr/lifo/Members/David.Teller
> - Laboratoire d'Informatique Fondamentale d'Orleans
>
> ___
> Es4-discuss mailing list
> Es4-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


Type Annotations ?

2007-10-03 Thread David Teller
Hi everyone,
 I'm still working on my static analysis tool for ES4. This tool will
make use of custom type (or type-like) annotations. I wonder if there
are already syntax guidelines for this kind of things. I assume I should
put them somewhere in comments. Should I use something like Java's
@annotation tag ?

Thanks,
 David


-- 
David Teller --
Security of Distributed Systems ---
-- http://www.univ-orleans.fr/lifo/Members/David.Teller
- Laboratoire d'Informatique Fondamentale d'Orleans

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss