Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1595
| From | JJ <wateronwildfire@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Selecting round parentheses arguments |
| Date | 2011-04-11 11:07 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <inundn$2eu$1@smc.vnet.net> (permalink) |
I see, thank you again for the explanations.
> The problem is once you hit enter so as to make the assignment
> to p, Mathematica will evaluate the RHS of your expression. That
> will eliminate the unneeded paratheses and re-arrange the order
> of the sub terms to a canonical order. That is
>
> In[2]:= p = {a b (c 3 d) + a c (b^2 5), b (c + d 4) - a, -(a^3
> d) c}
>
> Out[2]= {5 a b^2 c+3 a b c d,b (c+4 d)-a,-a^3 c d}
>
> So, the information needed to accomplish what you want is lost.
>
> The simplest way I know to do what you are asking in Mathematica
> is to enter the RHS as a string, use the various string
> functions in Mathematica to extract the desired portion and
> finally use ToExpression to convert the extracted portion of the
> strings to expressions.
>
> The other approach would be to use Hold to prevent evaluation of
> the RHS, then manipulate the result.
>
> But neither of these strike me as being "a quick way" to achieve
> your desired goal.
>
>
> First, if you want to do this by hand, it is possible to click inside an
> expression, and then spread the selection to cover successively larger
> sub-expressions using Ctrl-. This would allow you to select, and then
> copy particular parenthesised expressions.
>
> Alternatively, you could write code to read a cell in BoxForm, and seek
> out sub expressions of the BoxForm of the form RowBox[{"("........ I
> don't know that this would really be worth the effort.
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Selecting round parentheses arguments JJ <wateronwildfire@gmail.com> - 2011-04-11 11:07 +0000
csiph-web