lua-users home
lua-l archive

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


It was thus said that the Great Petite Abeille once stated:
> 
> Out of curiosity… as the 46 (and counting) messages in this thread haven't
> made it very clear, at least to me… why do we even care if a number is an
> integer, float, real, double, whatnot? Isn't the purpose of that int vs.
> float dichotomy to be purely an implementation detail? Wholly transparent?
> And a number stays a number? Irrespectively of internal representation?
> Or?

  As a side project, I'm playing around with bindings to ptrace().  ptrace()
is a function that deals primarily with addresses [1].  On a 32-bit system
there is no real issues [2] but on a 64-bit system it really is an issue
[3].  But I'm willing to conceed that what I'm working on might be a bit out
there.

  -spc (But other than that, yes, I haven't really had an issue with Lua
	numbers ... )

[1]	In another process no less!

[2]	Well, addresses are technically 32 bit unsigned quantities but
	lua_Integer is a signed quantity.  I am trying to be very careful on
	how I write the interface to ptrace(), but it's still mostly
	untested code at this point.

[3]	I did do a "proof-of-concept" 64-bit version of the code, but
	instead of:

		uint32_t addr = SOMEVALUE;
		lua_pushnumber(L,addr);

	I did:

		uint64_t addr = SOMEVALUE;
		lua_pushlstring(L,(char *)&addr,sizeof(addr));

	with some other minor tweaks to the Lua side of things.  It works,
	but I'm not fully happy with it.