Quote Originally Posted by peter View Post
Also I have been playing with a new routine, but I need to return a list of sublists ( as a result buffer).

I have been playing around with Lists, Arrays, Structures, but nothing has the versatility of a LISP List.

Suggestions or examples?

I want to be able to manipulate one of the above data types in .net and convert it to a result buffer as a return value.

I want each cell in the 2d array to contain any of the object types.
I believe this is what you're after:

Quote Originally Posted by Returning nested list from .NET to LISP, by Adam Nagy

Returning nested list from .NET to LISP

...

You can find the ResultBuffer TypedValue related codes in the LispDataType enum. As you can see RTRESBUF/5023 is not in the list. You could place the nested part in a LispDataType.ListBegin/LispDataType.ListEnd section instead:

Code:
[LispFunction("GetNestedList")]
public static ResultBuffer GetNestedList(ResultBuffer resBufIn)
{
  ResultBuffer resBufOut = new ResultBuffer();
 
  resBufOut.Add(
    new TypedValue((int)LispDataType.Text, "Main List Item 1"));
 
  resBufOut.Add(new TypedValue((int)LispDataType.ListBegin));
    resBufOut.Add(
      new TypedValue((int)LispDataType.Text, "Nested List Item 1"));
    resBufOut.Add(
      new TypedValue((int)LispDataType.Text, "Nested List Item 2"));
  resBufOut.Add(new TypedValue((int)LispDataType.ListEnd));
 
  resBufOut.Add(
    new TypedValue((int)LispDataType.Text, "Main List Item 2"));  
 
  return resBufOut;
}