help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of constants.


From: Muthiah Annamalai
Subject: Re: List of constants.
Date: Sat, 10 Feb 2007 11:56:09 -0600

On Sat, 2007-02-10 at 12:52 +0100, David Bateman wrote:

> Muthu,
> 
> I think it might be better to store the NIST data and a script to create
> the functions. 

At present I have asked the NIST people who maintain that page, about
terms of distributing the data file. I think we cant just do that,
without actually asking them, or we have a better public-domain source.

> This might be in the sub-directory src/ with a script and
> Makefile to built the functions. This allows new functions to be
> automatically added by updating the database and repackaging.
> 
I agree.

> Also I'm not sure its a great idea to have a function for each constant,
>  as you increase the chances of a collision with one of the users
> functions.
I was think in terms of C's #defines, and that could give an idea for me
that it was something that you cant touch upon. I was looking for some
function that can mark-off the variable as a const-function in
Octave-land.

>  I think I'd prefer a function that took a string argument,
> converted to lower case and found the minimum unique matching string and
> returned the matching constant. That is
> 
> c = physical_constant("SpeedOf")
> 
MM, well then what about help? I agree, however that
it is more elegant than, having like a zillion files, with mostly the
same content, true.

> would match "speedoflight", but if both "speedoflight" and
> "speedofunladenpigeon" were defined
> 
> c = physical_constant("SpeedOf")
> 
> should throw an error as an ambiguous request for a constant. In any
> case this is just a preference of how I would implement this if I was
> doing it..
> 

mm, I guess this is something I didnt think about, obviously.. .so will
fix it.

~ Muthiah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]