Generic Programming on the Nesting Structure of Arrays

نویسندگان

  • Stephan Herhut
  • Sven-Bodo Scholz
  • Clemens Grelck
چکیده

Multi-dimensional arrays lack expressiveness with respect to logical layers of data; they provide no means to encode that, for example, a three-dimensional array of double values is used to represent a matrix of RGB-values. Existing approaches, e.g., boxing and unboxing the inner dimensions of an array, allow the programmer to encode additional structure, but make programming on nested arrays a tedious and error-prone task: nesting and de-nesting operations have to be explicitly encoded in function applications. Apart from the additional work spent on program specification, this scattered encoding of structural information renders refactoring of widely used data structures difficult. We propose a new means to model the structure of homogeneously nested arrays in the type system, rather than the actual data. We exploit this additional type knowledge for subtypingbased function overloading, liberating the programmer from explicitly encoding nesting operations in function applications. Furthermore, we propose and demonstrate a nesting-structure generic programming extension that allows us to define user-defined homogeneously nested array-types without the usual boiler-plate code.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Generic Programming on the Structure of Homogeneously Nested Arrays

In this paper we propose a new means to model and operate on nested arrays that allows for a high level of abstraction without introducing a performance penalty. We achieve this by using a nesting structure on array types which allows us to shift the nesting information of arrays from the runtime representation level to the type system level. This information can then be exploited for generic f...

متن کامل

Mathematical Programming Models for Solving Unequal-Sized Facilities Layout Problems - a Generic Search Method

 This paper present unequal-sized facilities layout solutions generated by a genetic search program named LADEGA (Layout Design using a Genetic Algorithm). The generalized quadratic assignment problem requiring pre-determined distance and material flow matrices as the input data and the continuous plane model employing a dynamic distance measure and a material flow matrix are discussed. Computa...

متن کامل

Cross-Cultural Investigation into Generic Structure of Dissertation Acknowledgements in English and Persian: Reflections on Politeness Strategies

This contrastive study, in the first place, examined the generic structure and, in the second place, explored the face theory proposed by Arundale (2006) in 140 doctoral dissertation acknowledgments written by native speakers of Persian (NSP) and native speakers of English (NSE) in 7 disciplines representing soft sciences to find out what discourse genre components writers employ to articulate ...

متن کامل

A genre Analysis of the Scholarly Electronic Mail: Implications for ‎Pedagogy

Scholarly mails apparently display stable conventional principles as an emerging genre. Thus, contributors should structure their electronic mails appropriately when writing for purposes of discussing professional topics. However, this requirement plunges many a scholar in dilemma as to how to go about this vital undertaking without written structural norms in electronic mail communication. Thi...

متن کامل

Exploring Sub-Disciplinary Variations and Generic Structure of Applied Linguistics Research Article Introductions Using CARS Model

This paper explores sub-disciplinary variations and generic structure of research article introductions (RAIs) within three sub-disciplines of applied linguistics (AL); namely, English for Specific Purposes (ESP), Psycholinguistics, and Sociolinguistics, using Swales’(1990) CARS model. The corpus consisted of 90 RAIs drawn from a wide range of refereed journals in the corresponding sub-discipli...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008