James Clark

Results 508 comments of James Clark

What do you mean by > returning by an error value from a service declaration ? Please give an example. Things should work uniformly with listener declarations: https://ballerina.io/spec/lang/2021R1/#section_8.3.1

It's an interesting example. The type should clearly be anydata|string which is the same as anydata. But this example makes me think that we shouldn't allow `E?.x` when the static...

There are four possibilities for each branch of the union for an expression `E.s` 1. required individual field e.g. `record { string s; }` 2. optional individual field e.g. `record...

I've been meaning to comment on this. One of the design points of the Ballerina time APIs is that they handle leap seconds properly. Although they are an immense pain...

We decided to follow Java here: https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-LeftHandSide We can reconsider at a future date, if it turns out to be a significant problem in practice.

I guess the question is whether `var` is inferring a type (a set of shapes) or a type-descriptor (which has stuff like defaults, in addition to a shape). It's simpler...

The overall language direction is *not* to encourage people to use `var` as much as possible. Your example would be much better written as: ``` Foo x = { i:...

If we add it, it should be called `includes` for consistency with lang.string.

ECMAScript has this too: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

I think probably we should add for consistency with lang.string and ECMAScript/JavaScript. It should have an additional argument, defaulting to zero, saying where to start looking from.