Purpose of Definitions?


#1

Hi,

I am curious why you would ever use definitions when LWRPs exist?
AFAICT they are just a pseudo-resource with a somewhat more complex
syntax. Are they legacy from before LWRPs or am I missing something?


Cheers,

Peter Donald


#2

On 3 April 2012 15:30, Peter Donald peter@realityforge.org wrote:

Hi,

I am curious why you would ever use definitions when LWRPs exist?
AFAICT they are just a pseudo-resource with a somewhat more complex
syntax. Are they legacy from before LWRPs or am I missing something?

They sure are legacy! You can think of them more like a macro, when
you use it in a recipe, the body is replaced with the contents of the
definition, with the parameters all obviously available.

I have seen some varied usage of mix-matching definitions and lwrps,
especially when you need to group multiple lwrps togethers. Some might
argue for a purist approach.

–AJ


Cheers,

Peter Donald