Re: list referencing with [[]][[]]
- To: mathgroup at smc.vnet.net
- Subject: [mg14024] Re: list referencing with [[]][[]]
- From: mefisher at my-dejanews.com
- Date: Wed, 16 Sep 1998 14:12:04 -0400
- Organization: Deja News - The Leader in Internet Discussion
- References: <6ten4b$3ea@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <6ten4b$3ea at smc.vnet.net>, Allan Hayes <hay at haystack.demon.co.uk> wrote: > t[[1]][[2]] is equivalent to t[[1,2]] for extraction of parts, as > indicated by your example. > But for part resetting, as in your second example, it in not equivalent. > The catch is that part resetting like > a[[3]] = 7 > works only when > 1) a is a symbol that has been assigned an expression expr with > a = expr > (a:= expr will not do) 2) expr has a part 3 > > During evaluation, > anotherlist[[2]][[1]] = 7 > (that is (anotherlist[[2]])[[1]] = 7 ) becomes > > {3,4} [[1]] = 7 > which does not meet requirment 1). > > Allan Do you just know this from experimentation or is there somewhere to look this up (and evaluation issues like this)? --Mark. mark.fisher at atl.frb.org -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum