MathGroup Archive 2006

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

Search the Archive

Re: Null's not null?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69414] Re: [mg69393] Null's not null?
  • From: Igor Antonio <igora at wolf-ram.com>
  • Date: Mon, 11 Sep 2006 05:39:15 -0400 (EDT)
  • Organization: Wolfram Research, Inc.
  • References: <200609101120.HAA11248@smc.vnet.net>
  • Reply-to: igora at wolf-ram.com

AES wrote:
> Putting Null into one or more slots in a Table and printing the Table 
> shows "Null" (without quotes) at the corresponding positions, as also 
> does ToString[Null].  I don't think that's what the Help message says:
> 
>       "Null is a symbol used to indicate the absence of an 
>        expression or a result. When it appears as an output 
>        expression, no output is printed."
> 
> I can use a string with a couple of empty spaces ("__") to represent an 
> occupied but not empty slot in a Table, but that just looks clumsy to 
> me.  Is there a truly non-printing Null symbol?

The help message is correct.  Here's an example:

In[1]:= f[x_] := Null

In[2]:= f[1]

<nothing was returning.  no output cell.>

In[3]:= f[5] // InputForm

Out[3]//InputForm=

Null

In the example you mentioned, Null isn't the output of Table.  Table 
returns a list:

In[6]:= Table[, {i, 0}]

Out[6]= {}

You could use the empty string (""), which won't take up space and won't 
be displayed in standardform.

In[7]:= Table["", {i, 5}]

Out[7]= {"", "", "", "", ""}

In[8]:= Table["", {i, 5}] // InputForm

Out[8]//InputForm=

{"", "", "", "", ""}


Igor

PS: Null and "Null" are not the same thing.  One case would be when 
working with string matching.



--
Igor C. Antonio
Wolfram Research, Inc.
http://www.wolfram.com

To email me personally, remove the dash.


  • Prev by Date: Re: Re: [TS 22578]--Re:does anyone have an ant task for mathematica?
  • Next by Date: Re: Null's not null?
  • Previous by thread: Null's not null?
  • Next by thread: Re: Null's not null?