Unified selection from lists, arrays, and objects

  • Authors:
  • John C. Lusth

  • Affiliations:
  • Department of Computer Science and Computer Engineering, University of Arkansas, Fayetteville, AR 72701, USA

  • Venue:
  • Computer Languages, Systems and Structures
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

The first language computer science students learn, more often than not, is a common production language such as C++ or Java. A minority of curricula, however, begin with a language, such as Scheme, assumed to be a better framework for teaching about computation. SWAY is an experimental teaching language, as expressive as Scheme, but provides an easier transition to production languages. It is a functional language at its core, but adds assignment and a simple object system. One of the goals of SWAY is to incorporate C-style syntax, but to vary from that syntax when pedagogical or ease of programming needs arise. One such area that SWAY differs from languages with C-like expressions is in the selection of items from homogeneous and heterogeneous aggregates. Much like the overloading of the plus operator to add integers as well as reals, a single operator is used for selection in SWAY, regardless of the aggregate structure. It is shown that taking such an approach naturally eases the burden of moving from arrays to objects to lists, in any order, both in teaching and programming.