MathGroup Archive 2005

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

Search the Archive

Re: Types in Mathematica, a practical example

  • To: mathgroup at
  • Subject: [mg62946] Re: [mg62800] Types in Mathematica, a practical example
  • From: Sseziwa Mukasa <mukasa at>
  • Date: Fri, 9 Dec 2005 05:10:27 -0500 (EST)
  • References: <000f01c5fbf8$e3979330$>
  • Sender: owner-wri-mathgroup at

On Dec 8, 2005, at 8:11 AM, Ingolf Dahl wrote:

> Thanks for all answers.
> In my previous submission I asked for a way to define/declare list  
> with
> undefined elements.


> What I would prefer is a new Mathematica word: "Undefined". Then I  
> could
> define a list x as
> x = {1,Undefined,2};
> x[[1]] should evaluate to 1 as usual, but for this word "Undefined"  
> the list
> part x[[2]] should evaluate to x[[2]], precisely as for an undefined
> unindexed symbol.
> x[[4]] should give the usual error message:
> "Part::partw: Part 4 of {1, Undefined, 2} does not exist."
> x[[3]] =. and Clear[x[[3]]] should redefine x as  
> {1,Undefined,Undefined},

You can already do this:




> and x = Undefined should be interpreted as x =.

This would be problematic because x=Undefined assigns a value to x,  
x=. also assigns x a value but it's a different value, anything that  
depended on that behavior would break.

In the sense of a general name for an undefined term, some languages  
offer a value called bottom, that would be an interesting addition to  
Mathematica but as far as I can tell it's not a common feature of  
LISP like languages.



  • Prev by Date: Re: Delayed Evaluation of NDSolve Arguments
  • Next by Date: Re: exponential diophantine equations
  • Previous by thread: Re: Types in Mathematica, a practical example
  • Next by thread: Re: Types in Mathematica, a practical example