Referencing material functions from inside a custom expression

Yup! For loops work. You can write regular hlsl or cg in the custom expression node. It can even call other custom expression node functions, but material functions really don’t seem to exist as anything other than inline statements. That’s a shame, because it’d be nice as an option to have them as fragments as well.