Up to this point we have avoided it, and it's not on the roadmap. There have been a few discussions in the past about why we haven't done this to date.

If someone wanted to tackle this feature, the first thing that would need to be done is to make the compiler ok with references to structs that don't appear before them lexically. From there it probably wouldn't be too much of challenge. Maybe David or someone else with a deeper sense can chime in?

-Bryan

On Aug 4, 2009, at 9:50 AM, Samir Mulder wrote:

Hi,

I've been using Thrift for over a year now and love it. It has really increased my productivity in rolling out distributes services.

But the project I'm working on now needs a feature I haven't needed before and Thrift does not seem to support it. And that is recursion in a datatype. The example is that of a folder with subfolders:

struct Folder
{
  1: some data....
  2: list<Folder> subfolders
}

The compiler does not allow this since the type 'Folder' is not yet defined when it reaches the 'subfolders' item.

For this particular project allowing recursion is critical. Google Protocol Buffers supports it but I don't really want to switch to that this late in the game.

Any ideas on how to work around this? Is something like this planned for a future release?

Thanks.

Samir

Reply via email to