Re: = or := ???
- To: mathgroup at smc.vnet.net
- Subject: [mg30680] Re: = or := ???
- From: "Orestis Vantzos" <atelesforos at hotmail.com>
- Date: Sat, 8 Sep 2001 02:22:21 -0400 (EDT)
- Organization: National Technical University of Athens, Greece
- References: <9n18cn$26b$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I can't verify the validity of this, but try using RuleDelayed :> instead of Rule -> in the zzz->list[[i]] and switch to Set. Orestis PS.Or you can just ignore (or even turn of the Part Specification messages) if your code works :-) "Oliver Friedrich" <oliver.friedrich at tz-mikroelektronik.de> wrote in message news:9n18cn$26b$1 at smc.vnet.net... > Hallo, > > I'm in trouble with defining a function (in fact at the moment it works the > way I wanted, but with horrible workarounds). > > I did some computations which led me to a list rule1={xxx->yyy} with a long > 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 with > 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 is > evaluated repeatedly from within any point in my sessions, and I can't rely > on % anymore. > It should work with Set, if I could tell Mathematica that the list_ argument > in function represents a list. How can this be done (define the "type" of 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 > > > > > >