We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Dynamic lists and Templates
Page Index Toggle Pages: 1
Dynamic lists and Templates (Read 856 times)
Dynamic lists and Templates
May 25th, 2005, 1:23am
 
Hey all

Just wondering if processing allows C++-esque templates or anything similar? I'm trying to write something equivalent of the std::list in the C++ STL library (basically a dynamic array for any data type).

Processing does have the Array object - but I want to have a list of custom data types, like a new class. I wrote a basic one - but the problem is it's limited to one particular data type. To make it support more you have to re-write new version s of the list class.

If anyone has any suggestions I'd like to hear! (I'm very new to processing).

Sketch @ source code at http://www.vlc.ac.nz/dev/koriner/processing/projects/particles/
(the list class is at the very bottom)
Re: Dynamic lists and Templates
Reply #1 - May 25th, 2005, 3:13am
 
since processing just has java underneath, you can use the java collections classes, which give you similar sort of functionality as you'd get from stl.

however for actual "templates" you would need java 1.5, which handles more of these things, but we've so far shied away from because of other issues:
http://processing.org/faq/platforms.html#java
Re: Dynamic lists and Templates
Reply #2 - May 25th, 2005, 5:18am
 
Ah ok that's interesting. I think I've got Java 1.5 installed actually. I don't know Java but I'll read up on those functions.

I did notice some things were running a lot slower inside a browser.

Perhaps I should downgrade to 1.4

Page Index Toggle Pages: 1