# Recursion in Quartz Composer



## Mikuro (May 28, 2006)

I've just started playing around with Quartz Composer, and I'm trying to port a Cocoa screensaver I made to a Quartz Composition.

The problem is that I can't figure out how to do anything like a recursive function in QC. Is there any way to do this in QC?

I thought I'd just use an Iterator and have each iteration store some values for the next one, and increase the iteration count as necessary. Buuuut I can't publish outputs from an Iterator, QC doesn't seem to have any way to store variables eek, AND it prohibits input/output loops. So that idea seems very thoroughly thwarted.

Any ideas? I hope I'm missing something simple.


----------



## symphonix (May 29, 2006)

QC relies on Macro Patches to take care of complex structures. These aren't nearly as powerful as a real programming language, but can be used in some clever ways to get recursion, loops and so on. 

Here is some good reading material: http://www.quartzcompositions.com/phpBB2/mediawiki/index.php/Custom_Macro_patches


----------

