BitSpec

Quick Links

Overview

This topic provides general information on the implementation of the Type BIT. From the Common Lisp HyperSpec, "The type Bit is equivalent to the type (integer 0 1) and (unsigned-byte 1)." What this means is that a bit can be one of two values: the integer 0 or the integer 1. The type bit is a subtype of FixNum.

References

HyperSpec CLtL
Index of B .
Type BIT .

Type Obj 1 Obj 2
CLHS: Type BIT 2.5.3 Bit-Vectors BitArrays

How are Bits Created?

Bits are created by a Factory class contained in the Integer class (lisp.common.type.Integer). When the lisp user wants to create a Integer, the system will send that number to the Integer class. The Integer class first determines if the number falls within a certain range. If it does fall within that range then it creates a FixNum. If it doesn't fall in that range it creates a BigNum. The range for FixNums is implementation dependent. For CLforJava that range is -2147483648 to 2147483647. If it is determined that the number is going to be created as a FixNum, it will perform one more check. This check is to see if the value is zero or one. If the value is zero or one, a Bit is created, otherwise it justs creates a FixNum.

Implementation

The type Bit will be created as a interface in lisp.common.type. Since bit is a subtype of FixNum the interface will extend the FixNum interface. The type Bit will contain two Bits that represent the value of zero and the value of one.

Bit Value
ZERO new BitImpl("0")
ONE new BitImpl("1)

The Bit type will be implemented in lisp.system in a class called BitImpl.

Note: The String val at this point will either be a zero or a one.

Constructor Notes
public BitImpl(String val) Calls the super class (FixNumImpl) to handle the creating

Methods - Interface Bit (lisp.common.type.Bit)
Java Status
void setBit (Integer); not completed
Integer getBit (); not completed

Core Java Interfaces

Interface Status
Bit Not Complete

Core Java Classes

Class Status
BitImpl Not Complete

Discussions

Current Status of BitSpec

Test Suites

Topic revision: r11 - 2009-03-11 - 20:26:21 - MadelineWilliams
 
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