Hi !
Le 09/01/2014 16:17, Joey a écrit :
On 01/09/2014 03:08 PM, darkbatcher wrote:
Hi !
Why the hell want you to use litterals beginning with numbers ? for
years, most programming language have forbiden symbols beginning with
numbers, i can't see the benefits of such a feature. To me, it is
nothing but a bad idea...
About the support of hexadecimal notation, i had though about adding
such features for my own project. But i realised that the support of
hexadecimal values (refering to "integer hexadecimal") wasn't
interesting since hexadecimal notation is only interesting if logical
and bitwise operation are available, and that does not make sense as
libmatheval is designed for floating point features...
Regards,
Romain GARBI
Hi,
Because string literals are easy to work with and easy to understand.
And as you may know, I'm talking about color values.
The hex rgb representation of the color /green/ would be 00 FF 00.
Naturally, this ends up with string literals beginning with a number.
My program is not a programming language. My thoughts were simply, if
00FF00 can not be a valid value, why not just regard
it as a variable instead of a segfault?
Is libmatheval designed solely on floating point?
Hi !
The fact was that I didn't realised what you wanted. I just said it
doesn't seemed to be a good idea to use symbols begining with numbers,
but it can however easily be achieved.
And yes, libmatheval is only based on floating point arithmetic, it just
provides operations and function for floating numbers. Moreover, adding
integer arithmetic (ie. logical and bitwise operations) does not make
sense for floating numbers (as floating numbers are not represented by
an obvious bit sequence) and would make the code bigger
and harder to maintain. This is indeed against the *NIX philosophy, a
program shall do only one thing, but do it the best possible. It can be
sum up by "keep it simple".
I was confronted to this problem some time ago for an interpreter that
must handle both integers and floats. I found that extending libmatheval
for doing that wasn't interesting and far to hard. So I decided to
create my own library for handling only integers. You can find it there
: http://sourceforge.net/p/dos9/code/ci/master/tree/ (have a look on
libinteval directory). You might need to change the Makefile if you want
to build it.
regards,
Romain