       Re: Re: Debracketing array symbols

• To: mathgroup at smc.vnet.net
• Subject: [mg92197] Re: [mg92159] Re: Debracketing array symbols
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Tue, 23 Sep 2008 07:29:08 -0400 (EDT)

```Clear[A]

A

A = Array[a, {4}]

{a(1),a(2),a(3),a(4)}

{a(1),a(2),a(3),a(4)}

Consequently, if A were defined using A vice a on the RHS there would be an infinite recursion

Bob Hanlon

=============
> deBracket[x_] :=
>  x /. A_Symbol[n__Integer] :>
>    ToExpression[
>     StringJoin[Prepend[ToString /@ {n}, ToString[A]]]]
>
> X // deBracket
>
> X1
>
> {A, A, A, A} // deBracket

Elegant.

A related question   A={A, A, A, A}  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, A, A, A} //FullForm   just shows
List[A,A,A,A]  which does not tell me much.
Where is the role of A in the RHS explained in the documentation?.

--

Bob Hanlon

```

• Prev by Date: Re: How to consider two fitting methods when using Findfit in Mathematica
• Next by Date: Re: Crash in PNG.exe
• Previous by thread: Re: Debracketing array symbols
• Next by thread: Re: Debracketing array symbols