MathGroup Archive 2001

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

Search the Archive

Re: = or := ???

  • To: mathgroup at
  • Subject: [mg30680] Re: = or := ???
  • From: "Orestis Vantzos" <atelesforos at>
  • Date: Sat, 8 Sep 2001 02:22:21 -0400 (EDT)
  • Organization: National Technical University of Athens, Greece
  • References: <9n18cn$26b$>
  • Sender: owner-wri-mathgroup at

I can't verify the validity of this, but try using RuleDelayed :> instead of
Rule -> in the zzz->list[[i]] and switch to Set.
PS.Or you can just ignore (or even turn of the Part Specification messages)
if your code works :-)

"Oliver Friedrich" <oliver.friedrich at> wrote in message
news:9n18cn$26b$1 at
> Hallo,
> I'm in trouble with defining a function (in fact at the moment it works
> way I wanted, but with horrible workarounds).
> I did some computations which led me to a list rule1={xxx->yyy} with a
> expression.
> The next is, that I want to set up a function where expr is modified by
> rule1 and then by rule2
> function[s_,list_] :={{expr /.% /.zzz->list[[1]]},{expr /.%
> /.zzz->list[[2]]},{expr /.% /.zzz->list[[3]]}}
> Now for the traps: I want to use rule1 with the % because I don't want to
> give that Output a name (never need it again). Now if I define function
> Set, I get the error that PartSpecification list[[_]] is longer than depth
> of object (I Know what this error means, no problem about this).
> If I define with SetDelayed, I can't use my % notation, because function
> evaluated repeatedly from within any point in my sessions, and I can't
> on % anymore.
> It should work with Set, if I could tell Mathematica that the list_
> in function represents a list. How can this be done (define the "type" of
> what a symbol stands for?). I played around with some Hold[] stuff, but
> that's not the way, I want to have it.
> Any help appreciated !
> Oliver Friedrich

  • Prev by Date: JLink an animated gif
  • Next by Date: SqrtMod function
  • Previous by thread: = or := ???
  • Next by thread: Re: = or := ???