Anyone see any problems with doing this? Note outList is passed by reference
static void PairToList(Object^ o, TypedValueList ^%outList )
{
if(o->GetType() == LSharp::Pair::typeid)
{
LSharp::Pair ^p = (LSharp::Pair^)o;
outList->Add(TypedValue((short)LispDataType::ListBegin));
for each(Object^ ob in p)
{
PairToList(ob , outList);
}
outList->Add(TypedValue((short)LispDataType::ListEnd));
}
else
{
outList->Add(MCmds::ObjectToTypedValue(o));
}
}
From just looking at it, I don't see anything that sticks out, aside
from the fact that if TypedValueList is a reference type (e.g. a
class), there shouldn't be any need to pass it by-reference, since
it already is a reference to an instance, rather than a copy of it.