LispSymbol.h compiles.
[lispp.git] / LispSymbol.h
blob0be3e2cf481473bdbb8773dea7ec15df3644a648
1 #if !defined(LISP_SYMBOL_H_INCLUDED)
2 #define LISP_SYMBOL_H_INCLUDED
4 namespace Lisp
8 struct Symbol : public LispObj
10 void make(const CharType *symname)
12 int i = 0;
14 object.setType(eSymbolObj);
16 // calc length
17 while (*symname != '\0')
19 ++i;
20 ++symname;
23 // insert the pigs
24 object.values.resize(i);
25 symname = symname - i;
26 i = 0;
27 while(*symname != '\0')
29 object.values.push_back( LispValue( *symname ) );
30 ++i;
31 ++symname;
35 std::size_t length() const
37 return object.values.size();
40 bool operator==(const Symbol& sym)
42 if (sym.length() == length())
44 bool result = true;
45 std::size_t i = 0;
47 while ((i < length()) && result)
49 result = (
50 CharType(sym.object.values[i]) ==
51 CharType(object.values[i]) );
52 i++;
54 return result;
56 return false;
60 } // end namespace lisp
63 #endif