{"title":"Three Patterns of Data Type Composition in Programming Languages","authors":"R. Batdalov, O. Ņikiforova","doi":"10.1145/3282308.3282341","DOIUrl":null,"url":null,"abstract":"Data type composition is used in programming languages to build complex data types (known as compound types) from simpler ones. Various programming languages of ten use common approaches to type composition, but their particular implementation and provided opportunities may differ between languages. The paper uses the patterns methodology to describe three recurring themes in data type composition: traversing a set of values (the Traversable Once pattern), providing a slot to assign a value (the Assignable Once pattern) and variables that do not have to contain a value (the Optional Value pattern). These patterns are general cases of a number of constructs used for building compound data types in various programming languages. The described patterns may be used by designers of programming languages, libraries and frameworks to support the corresponding data type composition mechanisms directly in the language or their replacement at a higher level. Users of languages, libraries and frameworks may use the description of the patterns to understand underlying mechanisms and related benefits and liabilities.","PeriodicalId":136534,"journal":{"name":"Proceedings of the 23rd European Conference on Pattern Languages of Programs","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2018-07-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 23rd European Conference on Pattern Languages of Programs","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3282308.3282341","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2
Abstract
Data type composition is used in programming languages to build complex data types (known as compound types) from simpler ones. Various programming languages of ten use common approaches to type composition, but their particular implementation and provided opportunities may differ between languages. The paper uses the patterns methodology to describe three recurring themes in data type composition: traversing a set of values (the Traversable Once pattern), providing a slot to assign a value (the Assignable Once pattern) and variables that do not have to contain a value (the Optional Value pattern). These patterns are general cases of a number of constructs used for building compound data types in various programming languages. The described patterns may be used by designers of programming languages, libraries and frameworks to support the corresponding data type composition mechanisms directly in the language or their replacement at a higher level. Users of languages, libraries and frameworks may use the description of the patterns to understand underlying mechanisms and related benefits and liabilities.