|
|
От: | vaa | |
| Дата: | 09.11.22 14:12 | ||
| Оценка: | 9 (1) | ||
по AOT для F# "еще работают". Видать слишком много метапрограммистской магии.Given the following C# data type:
public sealed class Person
{
public int Id { get; init; }
public int Name { get; set; }
public int Surname { get; set; }
public Person Set() => this;
}
Before, in F# 6, the following code would’ve compiled and mutated the property Id of the Person:
let person = Person(Id = 42, Name = "John", Surname = "Doe")
person.Id <- 123
person.set_Id(123)
person.Set(Id=123)