Re: Debracketing array symbols
- To: mathgroup at smc.vnet.net
- Subject: [mg92159] Re: Debracketing array symbols
- From: carlos at Colorado.EDU
- Date: Mon, 22 Sep 2008 05:25:12 -0400 (EDT)
- References: <gb2e6u$bp0$1@smc.vnet.net>
> deBracket[x_] := > x /. A_Symbol[n__Integer] :> > ToExpression[ > StringJoin[Prepend[ToString /@ {n}, ToString[A]]]] > > X[1] // deBracket > > X1 > > {A[1], A[2], A[3], A[4]} // deBracket Elegant. A related question A={A[1], A[2], A[3], A[4]} produces infinite recursion in 4.2 and 5.2 (NB - I prepare all coursework with 4.2 for compatibility with some remote students in industry) Is the symbol A used on the RHS? {A[1], A[2], A[3], A[4]} //FullForm just shows List[A[1],A[2],A[3],A[4]] which does not tell me much. Where is the role of A in the RHS explained in the documentation?.