User Tools

Site Tools


reflection-field-selection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
reflection-field-selection [2020/01/31 15:37]
barryfp
reflection-field-selection [2020/02/11 06:21] (current)
barryfp [Reflection]
Line 68: Line 68:
  
 This will create a new data instance with all of the fields given in the type ''​t''​. This will create a new data instance with all of the fields given in the type ''​t''​.
 +
 +For arrays, we can combine type assignment with value construction,​ using the syntax:
 +
 +''​Data d[] = new Data[](a, b) from t''​
  
 Combined with field selection, reflection allows you to create new data types and populate all of their fields in a completely dynamic way. Combined with field selection, reflection allows you to create new data types and populate all of their fields in a completely dynamic way.
reflection-field-selection.txt ยท Last modified: 2020/02/11 06:21 by barryfp