MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Holding Arguments in a Second Argument List

  • To: mathgroup at
  • Subject: [mg32238] Holding Arguments in a Second Argument List
  • From: "David Park" <djmp at>
  • Date: Wed, 9 Jan 2002 03:17:32 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dear MathGroup,

I have a series of procedures which manipulate a matrix. I like to define
them in this fashion.

function[args___][matrix_] := ... because then I can write lines like

matrix // function[args...] etc.

But I have to define the function so that matrix is held, and I don't want
to write Unevaluated with every use. But Attributes = {HoldFirst} only
applies to the first argument list. Is there a direct way to define the
attributes of a second argument list?

In any case, I write the routines this way.

		Module[{}, code],

and that works. The code usually changes the matrix and I display it
separately. But sometimes the operation will fail and then I would like


to return $Failed. But I am unable to do that. The best I seem to be able to
do is return Return[$Failed].

Here is a sample routine which just tries to return $Failed.

foo[mathgroup_] :=
        If[Not[mathgroup === great], Return[$Failed]]],


Can anyone tell me how to get rid of the Return wrapper?


David Park
djmp at

  • Prev by Date: TeXForm and negative exponents
  • Next by Date: Re: System Ax=b!
  • Previous by thread: Re: TeXForm and negative exponents
  • Next by thread: Re: Holding Arguments in a Second Argument List