Our system in EU observed some slowness and a few 500 and 503 responses from `identitytoolkit.googleapis.com` over a period of about 10 minutes.
var x = new Car() with { make = "Volvo"; year = "2023"; };
If you want the Car constructor to enforce constraints, you could use this pattern in a separate Builder record: record Car(String make, String year) {
Car {
Objects.requireNonNull(make);
Objects.requireNonNull(year);
}
record Builder(String make, String year) {
Builder() {
this(null, null);
}
Car build() {
return new Car(make, year);
}
}
}
var x = new Car.Builder() with { make = "Volvo"; year = "2023"; }.build();
Obviously syntax TBD. Archive mode (start from the beginning of the RSS)
Automatic download
In my global settings, I have it set to keep at most 5 episodes per podcast. The result being that when I was done with one episode, it would automatically download the next, and I had a buffer of 5 episodes for trains and flights. Note too that if the canonical constructor checks invariants, then a with expression will check them too. For example:
record Rational(int num, int denom) {
Rational {
if (denom == 0)
throw new IllegalArgumentException("denom must not be zero");
}
}
If we have a rational, and say
r with { denom = 0; }
we will get the same exception, since what this will do is unpack the numerator and denominator into mutable locals, mutate the denominator to zero, and then feed them back to the canonical constructor -- who will throw.