fsharp / fsharp/fslang-suggestions
imply record labels from expressions
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 373
- Fork
- 21
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I propose we allow both records and anonymous records to imply record labels from a limited range of expressions, e.g. for anonymous records:
{| x.Name; x.Title |}
is the same as
{| Name=x.Name; Title=x.Title |}
The same would apply for records. The label names would be implied by a `expr.Name` lookup only.
It would be natural to do this at the same time as anonymous records.
The existing way of approaching this problem in F# is to write the label names explicitly.
## Pros and Cons
The advantages of making this adjustment to F# are succinctness
The disadvantages of making this adjustment to F# are you have to know the rule, and it makes the selection of type a little more implicit, especially in the case of records.
## Extra information
Estimated cost (XS, S, M, L, XL, XXL): M
Related suggestions: #207
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Esamina la sintassi proposta nell’issue per i record anonimi e i record, poi leggi il suggerimento correlato #207 e la cronologia della discussione per individuare le obiezioni irrisolte. Un contributo completo richiederebbe un design concordato per l’inferenza delle label basata solo su expr.Name e per la sua interazione con la selezione del tipo di record.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100