LispArray

Overview

This topic provides general information on the implementation of the Lisp Array. Residing just under ATOM, the Lisp Array provides the super structure for the array and string subtypes. From Common Lisp the Language 2nd Ed. "In general, arrays can be multidimensional, can share their contents with other array objects, and can have their size altered dynamically (either enlarging or shrinking) after creation." The Lisp Array provides the content-sharing/redimensioning methods as well as distributing the creational duties to the appropriate subtype.

Development schedule of Lisp Array:

  • Design
    • Backing Store -- How the Lisp Array will be stored in Java
      • Develop benchmark testing suite for the possible types
      • Analyze results of benchmark test suite
      • Compile and present results to project members
    • Class Factory -- Delegates which type is made
      • Design the delegation process (rules for handling the creational process)
      • Approve design
    • Displaced Arrays
      • DisplacedArrayImpl (Class removed from design)
    • Array Indexer
  • Implementation
    • Method Signatures -- Skeletons for the specified functions and accessors
      • Create signatures (including Javadoc)
      • Update TWiki in reflection to the signatures
    • Class Factory
      • Create class factory
    • Displaced Arrays with DisplacedArray (Class removed from design)
    • Dimension Calculations with ArrayIndexer
    • Java Accessors -- Methods that read or modify some attribute of the class
      • Getters
      • Setters
    • Test Creational Structure
    • Java Functions -- Methods that perform specilized functions on the instances of the class
    • Lisp Functions -- Methods that the LISP compiler will use to access the Java Accessors/Functions

|View current status|View status history|

References

StringsAndArrays

HyperSpec CLtL
Chap. 15 - Arrays 2.5 - Arrays

Implementation

Lisp Function/Accessor Implementation Status Table

The following table provides the implemented Lisp functions/accessors and their congruent Java methods.
This table is separated into Lisp functions and accessors.

Lisp Name Java Implementation Status
 
Lisp Functions
MAKE-ARRAY Factory.newInstance Complete
ADJUST-ARRAY adjust Complete
ADJUSTABLE-ARRAY-P isAdjustable Complete
ARRAY-DIMENSION getDimension Complete
ARRAY-DIMENSIONS getDeminsions Complete
ARRAY-ELEMENT-TYPE getElementType Complete
ARRAY-HAS-FILL-POINTER-P hasFillPointer Complete
ARRAY-DISPLACEMENT getDisplacedTo Complete
  getDisplacedIndexOffset Complete
ARRAY-IN-BOUNDS-P isInBounds Complete
ARRAY-RANK getRank Complete
ARRAY-ROW-MAJOR-INDEX getRowMajorIndex Complete
ARRAY-TOTAL-SIZE size Complete
ARRAYP use: "instanceof" NA
UPGRADED-ARRAY-ELEMENT-TYPE getUpgradedArrayElementType Not Started
Lisp Accessors
AREF get Complete
  set Complete
ROW-MAJOR-AREF getByRowMajor Complete
  setByRowMajor Complete

Any method links should point to the generated ClforJava Javadoc once it becomes availible.

Core Java Interfaces

Interface
Array
SimpleArray
ArrayIndexer
BackingStore

Core Java Classes

Class
Array$Factory
SimpleArray$Factory
ArrayImpl
ArrayImpl$ArrayIndexerImpl
SimpleArrayImpl
ArrayListBackingStore
DisplacedBackingStore

Array (lisp.common.type.Array)

The Lisp Array. Contains the methods that can be applied to the array and subtypes. Accessor functionality along with a few predicate methods are some of the basic functions that are provided. Some other functionaliy includes array displacement and adjustablility.

Method(s) - Interface Array (lisp.common.type.Array)
Method
adjust
get
getDimension
getDimensions
getDimensionsAsList
getDisplacedIndexOffset
getDisplacedTo
getElementType
getRank
getRowMajorIndex
hasFillPointer
isAdjustable
isDisplaced
isInBounds
makeArrayIndexer
makeDisplacement
resize
set
size

SimpleArray (lisp.common.type.SimpleArray)

The Lisp Simple Array. Extends Array. Provides the separation of the simple array type.

Method(s) - Interface SimpleArray (lisp.common.type.SimpleArray)
Method
None, same as Array

ArrayIndexer (lisp.extensions.type.ArrayIndexer)

A utility interface that specifies the Array Indexer type. See ArrayIndexerImpl.

Method(s) - Interface ArrayIndexer (lisp.extensions.type.ArrayIndexer)
Method
getLinearIndex

Array$Factory (lisp.common.type.Array.Factory)

Factory Array.Factory is a class that is given the purpose to delegate which type/subtype is to be created given some creational parameters. In the case of this factory, the class will decide whether an Array (itself), SimpleArray, or a Vector should be created. Once this decision is made, the factory will either create an instance of itself or delegate the creational process the another subtype. If the process is handed off to a subtype, the decision to either create the instance or pass the duty to another type will be up to the subtype. See the State Machine Design (Rev. 1.0) for details.

Method(s) - Class Array$Factory
Method
newInstance

SimpleArray$Factory (lisp.common.type.SimpleArray.Factory)

Factory SimpleArray.Factory is a class that is given the purpose to delegate which type/subtype is to be created given some creational parameters. In the case of this factory, the class will decide whether a SimpleArray (itself), or a Vector should be created. Once this decision is made, the factory will either create an instance of itself or delegate the creational process the another subtype. If the process is handed off to a subtype, the decision to either create the instance or pass the duty to another type will be up to the subtype. See the State Machine Design (Rev. 1.0) for details.

Method(s) - Class SimpleArray$Factory
Method
newInstance

ArrayImpl (lisp.system.ArrayImpl)

Class ArrayImpl. The implementation of Array.

Method(s) - Class ArrayImpl (lisp.system.ArrayImpl)
Method
ArrayImpl (constructor)
adjust
createBackingStore (private)
get
getDimension
getDimensions
getDimensionsAsList
getDisplacedIndexOffset
getDisplacedTo
getElementType
getRank
getRowMajorIndex
hasFillPointer
isAdjustable
isDisplaced
isInBounds
makeArrayIndexer
makeDisplacement
resize
set
size

ArrayIndexerImpl (lisp.system.ArrayImpl$ArrayIndexerImpl)

Class ArrayIndexerImpl. The implementation of ArrayIndexer.

Method(s) - Class ArrayIndexerImpl (lisp.system.ArrayImpl$ArrayIndexerImpl)
Method
ArrayIndexer (private constructor)
getLinearIndex

SimpleArrayImpl (lisp.system.SimpleArrayImpl)

Class SimpleArrayImpl. The implementation of SimpleArray.

Method(s) - Class SimpleArrayImpl (lisp.system.SimpleArrayImpl)
Method
SimpleArray (constructor)
adjust (overrides)
createBackingStore (private)
isAdjustable (overrides)

See LispBoolean? , ListFixnum? , LispList? , LispInteger?

Discussions

Links to issues:

Current Status of LispArray

Current Status: Almost Complete

  • Details
    • 12/09/05 - A few lisp functions left to implement and the chance of bug fixing remains.

Status History - Chronological per construct

  • Design::Backing Store
    • 09/29/05 - Building a test suite to benchmark the performace of java.lang.reflect.Array vs. primative type arrays to facilitate a better choice of backing store.
    • 10/04/05 - Analizing results of benchmark tests.
    • 10/07/05 - Presenting results to team members.
    • 10/12/05 - Ended up settling on the Java ArayList.
  • Design::Class Factory
    • 10/10/05 - Creating state diagram to represent the delegation pocess.
    • 10/10/05 - State Machine Design (Rev. 1.0)
    • 10/12/05 - Approved design of state machine for the class Factory.
  • Design::Displaced Arrays
    • 10/23/05 - Designing anonymous class.
  • Design::Displaced Arrays
    • 10/23/05 - Designing inner class
  • Implementation::Method Signatures
    • 10/12/05 - Creating method signatures (including Javadoc) for the Functions/Accessors.
    • 10/13/05 - Finshed creating method sigantures (including Javadoc and TWiki update).
    • 10/14/05 - Updated method signatures.
    • 10/21/05 - Updated method signatures.
    • 10/24/05 - Updated method signatures.
  • Implementation::Class Factory
    • 10/22/05 - Creating class factory.
    • 10/23/05 - Waiting on SimpleArray's Factory to be completed...
  • Implementation::Displaced Arrays
    • 10/25/05 - Implementing inner class DisplacedArrayImpl (Class removed from design).
    • 11/08/05 - Solidifying Displaced Arrays
  • Implementation::Dimension Calculations
  • Implementation::Java Accessors
    • 10/28/05 - Getters/Setters.
  • Implementation::Test Creational Structure
    • 10/28/05 - Validating the array structure through testing of accessor/setter methods.
  • Implementation::Java Functions
    • 10/28/05 - Implemented all but adjust and displaced array methods.
  • Implementation::Lisp Functions
    • 10/29/05 - Creating lisp functions, postponing checkArguments() implementations.
    • 11/07/05 - Most functions complete.
    • 12/09/05 - Main functions complete (accept setting functions and others see Functions/Accessors).

View development schedule

Open bug count: Zaro

Bug # Status
   

Test Suites

Not available at this time

Links to JUnit results

Not available at this time

-- JohnPrice - 10 Dec 2005

Topic attachments
I Attachment Action Size Date Who Comment
GIFgif LispArray.Factory-StateMachine_R1.0.gif manage 8.8 K 2005-10-11 - 02:21 JohnPrice State diagram, representing the interface factory delegation process (GIF)
Visio documentvsd LispArray.Factory-StateMachine_R1.0.vsd manage 119.5 K 2005-10-11 - 02:24 JohnPrice State diagram, representing the interface factory delegation process (Microsoft Visual Studio 2003)
Topic revision: r35 - 2006-10-14 - 01:00:19 - JohnPrice
 
Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback