From c0a3be39901f731c44194d20c91f0e01bf1ed286 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 29 Jan 2025 20:28:04 +0000 Subject: [PATCH] Add tip on useful applications of data classes --- articles/scripting-expressions-overview.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/articles/scripting-expressions-overview.md b/articles/scripting-expressions-overview.md index 99bf390d..b73edf5a 100644 --- a/articles/scripting-expressions-overview.md +++ b/articles/scripting-expressions-overview.md @@ -120,6 +120,9 @@ new( The example above projects the two unnamed items of a tuple into a new data object with an `X` and a `Y` property. +> [!Tip] +> Dynamic data classes are most useful when combined with operators which leverage the named structure of input types, e.g. [`CsvWriter`](xref:Bonsai.IO.CsvWriter) maps the type properties to header names. They are also useful to increase readability by naming the members of otherwise anonymous tuples, such as those generated by [`Zip`](xref:Bonsai.Reactive.Zip) and other combinators. + > [!Note] > Dynamic data classes are uniquely identified by their specification. If two data object initializers use matching property names with identical types declared in the same order, then the two expressions will be resolved to the same data object type. This allows type inference to work on reactive operators which require matching types in all the input sequences, e.g. [`Merge`](xref:Bonsai.Reactive.Merge).