Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

LReference Class Reference

#include <lisp.hpp>

Inheritance diagram for LReference:

Inheritance graph
[legend]
Collaboration diagram for LReference:

Collaboration graph
[legend]
List of all members.

Detailed Description

Reference to a Lisp S-expression.

This class only differs from SReference in that is has evaluation-related functions, the operator~(), the IsTrue(), IsEql() and IsEqual() functions.

If you don't need to evaluate an S-expression, it is better to use SReference as it is accepted by more function than LReference. They can be cast to each other though.

Definition at line 46 of file lisp.hpp.

Public Member Functions

 LReference ()
 Default constructor creates an unbound reference.
 LReference (const LReference &ref)
 Copy constructor.
 LReference (const SReference &ref)
 Cast constructor.
 LReference (SExpression *p)
 Cast from a plain pointer.
 LReference (UserLispFunction fun)
 Cast from UserLispFunction.
template<class X>
 LReference (X &x)
template<class X>
 LReference (const X &x)
 ~LReference ()
LReference Evaluate () const
 Evaluate the expression.
LReference Evaluate (class LispContinuation &within) const
 Evaluate the expression within an existing machine.
bool IsTrue () const
 Is the object 'true' in the sence of Lisp.
LReferenceoperator, (const SReference &ref)
 Add another element to list.
LReferenceoperator|| (const SReference &ref)
 Set the cdr of the last pair of list.
LReference operator~ () const
 Make the list (QUOTE *this).
bool IsEql (const SReference &other) const
 Is the object EQL (in the sence of CL) to the other.
bool IsEqual (const SReference &other) const
 Is the object EQUAL (in the sence of CL) to the other.
SString TextRepresentation () const
 Text representation.
SExpressionGetPtr () const
 Get a plain pointer.
SReferenceAddAnotherItemToList (const SReference &right)
 Add item to list.
SReferenceChangeListEnd (const SReference &new_last)
 Make/change dotted list.
SReference MakeCons (const SReference &right) const
 Make a cons.
SReference operator^ (const SReference &t) const
 CONS operation.
bool operator== (const SReference &other) const
 Equality is just pointer comparision.
bool operator== (const SExpression *other) const
 Equality is just pointer comparision.
bool operator!= (const SReference &other) const
 Non-equality is just pointer comparision.
bool operator!= (const SExpression *other) const
 Non-equality is just pointer comparision.
SReferenceCar () const
SReferenceCdr () const
SReferenceCCar () const
SReferenceCCdr () const
intelib_float_t GetFloat () const
intelib_integer_t GetInt () const
const char * GetString () const
char GetSingleChar () const
template<class Tp>
Tp * DynamicCastGetPtr () const
template<class Tp>
Tp * SimpleCastGetPtr () const
SReference Clone () const
SReference CopyList () const
SReference CopyTree () const
bool IsEmptyList () const
SExpressionoperator-> () const
 Field/method selection.
SExpressionoperator * () const
 Dereference.


Constructor & Destructor Documentation

LReference::LReference  ) 
 

Default constructor creates an unbound reference.

Definition at line 49 of file lisp.hpp.

Referenced by IsEqual(), operator~(), and TextRepresentation().

LReference::LReference const LReference ref  ) 
 

Copy constructor.

Definition at line 51 of file lisp.hpp.

LReference::LReference const SReference ref  ) 
 

Cast constructor.

Definition at line 53 of file lisp.hpp.

LReference::LReference SExpression p  ) 
 

Cast from a plain pointer.

Definition at line 55 of file lisp.hpp.

LReference::LReference UserLispFunction  fun  ) 
 

Cast from UserLispFunction.

Definition at line 24 of file lisp.cpp.

template<class X>
LReference::LReference X &  x  ) 
 

Definition at line 59 of file lisp.hpp.

template<class X>
LReference::LReference const X &  x  ) 
 

Definition at line 60 of file lisp.hpp.

LReference::~LReference  ) 
 

Definition at line 62 of file lisp.hpp.


Member Function Documentation

LReference LReference::Evaluate  )  const
 

Evaluate the expression.

This method creates a local object of LispContinuation and uses it to evaluate the expression. Consider it as a top-level form evaluation

Definition at line 28 of file lisp.cpp.

LReference LReference::Evaluate class LispContinuation within  )  const
 

Evaluate the expression within an existing machine.

The given LispContinuation's state is marked; then, the object is used to evaluate the expression (that is, *this is scheduled to be evaluated within that LispContinuation object, and the evaluation is launched to run until the marked state is reached again).

Warning:
In most cases this leaves the continuation exactly in the same state as it was in before the call; this is not guaranteed though.

Definition at line 34 of file lisp.cpp.

bool LReference::IsTrue  )  const
 

Is the object 'true' in the sence of Lisp.

Returns false in case the object stores the same pointer as PTheLispBooleanFalse variable does; otherwise, returns true.

Definition at line 128 of file lisp.hpp.

References SReference::GetPtr(), and PTheLispBooleanFalse.

LReference& LReference::operator, const SReference ref  ) 
 

Add another element to list.

Reimplemented from SReference.

Definition at line 91 of file lisp.hpp.

References SReference::operator,().

LReference& LReference::operator|| const SReference ref  ) 
 

Set the cdr of the last pair of list.

Reimplemented from SReference.

Definition at line 95 of file lisp.hpp.

References SReference::operator||().

LReference LReference::operator~  )  const
 

Make the list (QUOTE *this).

Definition at line 131 of file lisp.hpp.

References LReference(), PTheEmptyList, PTheLispSymbolQuote, and SReference::SReference().

bool LReference::IsEql const SReference other  )  const
 

Is the object EQL (in the sence of CL) to the other.

Reimplemented from SReference.

Definition at line 43 of file lisp.cpp.

References SReference::GetPtr(), SExpression::SpecificEql(), and SExpression::TermType().

Referenced by IsEqual().

bool LReference::IsEqual const SReference other  )  const
 

Is the object EQUAL (in the sence of CL) to the other.

Reimplemented from SReference.

Definition at line 51 of file lisp.cpp.

References SExpressionCons::Car(), SExpressionCons::Cdr(), IsEql(), and LReference().

SString LReference::TextRepresentation  )  const
 

Text representation.

This version differs from SExpression::TextRepresentation() in that it handles the QUOTE and FUNCTION forms

Definition at line 71 of file lisp.cpp.

References SExpressionCons::Car(), SExpressionCons::Cdr(), SExpressionCons::CoreTextRepresentation(), SReference::GetPtr(), SReference::IsEmptyList(), LReference(), PTheLispSymbolFunction, PTheLispSymbolQuote, SExpression::TermType(), and SExpression::TextRepresentation().

SExpression* SReference::GetPtr  )  const [inherited]
 

Get a plain pointer.

Reimplemented from GenericReference< SExpression >.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, SQueue, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 513 of file sexpress.hpp.

References GenericReference< Tp >::GetPtr().

Referenced by IntelibGenericReader::AddSequenceOpener(), IntelibX::AddStack(), LispLambdaBody::DoAnalyseLambdaList(), SReference::DynamicCastGetPtr(), SExpressionHashTable::FindItem(), SExpressionHashPackage::FindSymbol(), SExpressionHashTable::GetItemPosition(), SExpressionHashTable::Iterator::GetNext(), SQueue::GetPtr(), SBacklinkRef::GetPtr(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::GetPtr(), SExpressionHashPackage::Intern(), SchReference::IsEql(), IsEql(), SchReference::IsTrue(), IsTrue(), SReference::operator!=(), SBacklinkRef::operator,(), SReference::operator==(), SExpressionHashTable::RemoveItem(), RetrieveFunctionObject(), SExpressionHashTable::SafeAddItem(), SReference::SimpleCastGetPtr(), stack_representation(), IntelibContinuation::Step(), SExpressionHashTable::TextRepresentation(), SchReference::TextRepresentation(), TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SReference& SReference::AddAnotherItemToList const SReference right  )  [inherited]
 

Add item to list.

For a list, adds another dotted pair to its end. For non-lists, the result is undefined.

Referenced by SReference::operator,().

SReference& SReference::ChangeListEnd const SReference new_last  )  [inherited]
 

Make/change dotted list.

  • For a proper (non-dotted) list, replaces its terminating () with the given argument, therefore producing a dotted list.
    • for a dotted list, changes it's terminating value (the value which is after the dot)
    • for other types, the result is undefined

Referenced by SReference::operator||().

SReference SReference::MakeCons const SReference right  )  const [inherited]
 

Make a cons.

Produces a cons (dotted pair) using *this as the CAR and the given argument as the CDR

Referenced by SReference::operator^().

SReference SReference::operator^ const SReference t  )  const [inherited]
 

CONS operation.

Operator "^" is used to produce conses

Definition at line 552 of file sexpress.hpp.

References SReference::MakeCons().

bool SReference::operator== const SReference other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 556 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator== const SExpression other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 562 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SReference other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 559 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SExpression other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 565 of file sexpress.hpp.

References SReference::GetPtr().

SReference& SReference::Car  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SDoubleListRange::Copy(), IntelibGenericReader::Get(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::Cdr  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SBacklinkRef::Remove(), SQueue::RemoveFirst(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::CCar  )  const [inherited]
 

SReference& SReference::CCdr  )  const [inherited]
 

intelib_float_t SReference::GetFloat  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

intelib_integer_t SReference::GetInt  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

const char* SReference::GetString  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

char SReference::GetSingleChar  )  const [inherited]
 

template<class Tp>
Tp * SReference::DynamicCastGetPtr  )  const [inherited]
 

Definition at line 687 of file sexpress.hpp.

References SReference::GetPtr(), IntelibTypeId::IsSubtypeOf(), and SExpression::TermType().

Referenced by LispLambdaBody::DoAnalyseLambdaList(), SExpressionBacklink::InsertAfter(), SBacklinkRef::operator,(), pretty_print(), IntelibGenericReader::Read(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), RetrieveFunctionObject(), SQueue::SQueue(), and SExpressionBacklink::~SExpressionBacklink().

template<class Tp>
Tp * SReference::SimpleCastGetPtr  )  const [inherited]
 

Definition at line 695 of file sexpress.hpp.

References SReference::GetPtr(), and SExpression::TermType().

SReference SReference::Clone  )  const [inherited]
 

Referenced by SExpressionVector::Clone(), and SExpressionHashTable::Clone().

SReference SReference::CopyList  )  const [inherited]
 

SReference SReference::CopyTree  )  const [inherited]
 

bool SReference::IsEmptyList  )  const [inherited]
 

Referenced by SBacklinkRef::Begin(), LExpressionMacro::Call(), SExpressionBacklink::ConnectBack(), SDoubleListRange::Copy(), SBacklinkRef::End(), SExpressionDoubleList::Exclude(), SDoubleListRange::Exhausted(), SExpressionDoubleList::Iterator::Exhausted(), SDoubleListRange::GetLast(), SBacklinkRef::GetPtr(), SBacklinkRef::InsertAfter(), SExpressionDoubleList::InsertListAfter(), SExpressionDoubleList::Iterator::IsBegin(), SQueue::IsEmpty(), SExpressionDoubleList::Iterator::IsEnd(), SBacklinkRef::operator++(), SBacklinkRef::operator,(), SDoubleListRange::RightEndMover::operator--(), SDoubleListRange::LeftEndMover::operator--(), SBacklinkRef::operator--(), pretty_print(), SExpressionDoubleList::Iterator::Remove(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), SQueue::SQueue(), stack_representation(), SchReference::TextRepresentation(), TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SExpression * GenericReference< SExpression >::operator->  )  const [inherited]
 

Field/method selection.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 175 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().

SExpression & GenericReference< SExpression >::operator *  )  const [inherited]
 

Dereference.

Reimplemented in GenericSReference< Tp, X_wrongtype >, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 179 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().


The documentation for this class was generated from the following files:
Generated on Tue Dec 18 00:42:38 2007 for InteLib by  doxygen 1.4.1