MathGroup Archive 2005

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

Search the Archive

Re: Types in Mathematica

  • To: mathgroup at
  • Subject: [mg62836] Re: Types in Mathematica
  • From: Bill Rowe <readnewsciv at>
  • Date: Tue, 6 Dec 2005 00:43:03 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 12/5/05 at 3:37 AM, hattons at (Steven T. Hatton)

>I have come to realize that there are (or appear to be) certain
>limitations as to what can be done with type conversions in
>comparison to how they are used in C++.  For example, in C++ it is
>possible to create type conversion operators which will be invoked
>according to the parameters accepted by a function.  For example,
>you might have some kind of counter object which automatically
>converts to an integer when passed as a variable of integer type.

>I don't believe I could do something similar with Mathematica.  For
>instance, if I have a type Vector3D[x,y,z], I don't see a way of
>getting that to convert to a List[x,y,z] when passed to an
>arbitrary function taking a List as an argument.

I don't understand your comment here. I can easily do the following:

a = Vector3D[x, y, z]; 
b = List @@ a; 


Given this, why shouldn't Apply (@@) be considered a "type" conversion in this context?
To reply via email subtract one hundred and four

  • Prev by Date: Re: Threading 'Append'
  • Next by Date: Re: How to set up a diff equation for circuit with a diode?
  • Previous by thread: Re: Re: Types in Mathematica
  • Next by thread: Re: Types in Mathematica