exporting 3d graphics
Suppose you want to create a function which has optional arguments. Maeder's book Programming in Mathematica covers the topic extensively up to version 3, but some things have changed/evolved since...
ClearAll[LetL];
SetAttributes[LetL, HoldAll];
SyntaxInformation[LetL] = {
"ArgumentsPattern" -> {, },
"LocalVariables" -> {"Solve", {1, Infinity}}
};
LetL /: (assign : SetDelayed | RuleDelayed)[
lhs_,rhs : HoldPattern[LetL[{_}, ]]
] :=
Block[{With},
Attributes[With] = {HoldAll};
assign[lhs, Evaluate[rhs]]
];
LetL[{}, expr] := expr;
LetL[{head}, expr] := With[{head}, expr];
LetL[{head, tail_}, expr] :=
Block[{With}, Attributes[With] = {HoldAll};
With[{head}, Evaluate[LetL[{tail}, expr]]]];
If[FileExistsQ[$runningLogFile]
, Get[$runningLogFile]
, Export[$runningLogFile, "", "Text"];
]