MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Displaying results in a column

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104988] Re: Displaying results in a column
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 15 Nov 2009 20:49:56 -0500 (EST)
  • References: <hdgr97$jeq$1@smc.vnet.net> <hdlk5v$he1$1@smc.vnet.net> <hdomon$91r$1@smc.vnet.net>

AES wrote:
> In article <hdlk5v$he1$1 at smc.vnet.net>,
>  David Bailey <dave at removedbailey.co.uk> wrote:
> 
>>> {expr1, "\n"expr2, "\n"expr3, "\n"expr4, . . . }
>>>
>>> seems to work just fine (in putting sequential expressions on sequential lines)
>>>
> 
>> Note that as written, you are actually multiplying the subsequent 
>> expressions by the string "\n"! If one of your expressions happens to 
>> evaluate to 1, you will get a surprise! You should use Column, as others 
>> have already pointed out.
> 
> Haven't tried your surprise yet -- but I was surprised to find that
> 
>     "\n"expr1a + expr1b    and   "\n"(expr1a+expr1b)
> 
> functioned differently -- and now I understand why.
> 
> Is multiplying a general expression by a string ("\n") actually legal 
> syntax? (and if not, should my using it have triggered an error 
> message?)
> 
Multiplications involving strings just don't evaluate - they are not 
illegal as such!

The surprise was that some basic rules of arithmetic still get applied, 
which would be inconvenient for your intended use:

1 x <string> = <string>

0 x <string> = 0

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Text on a curve,
  • Next by Date: Re: Mathematica skill level snippet(s)
  • Previous by thread: Re: Re: Displaying results in a column
  • Next by thread: Re: Re: Re: Displaying results in a column