location on define-constant
Per Bothner
per@bothner.com
Mon Aug 6 07:19:00 GMT 2012
On 08/05/2012 11:36 PM, Chuah Teong Leong wrote:
> I just discovered that it is impossible to get a location on a
> variable defined using define-constant.
> Is there another way to pass a reference of such a variable then?
>
> (define-constant myint 12)
> (define myint-loc
> (location myint))
>
> java.lang.ClassCaseException: gnu.math.IntNum cannot be cast to
> gnu.mapping.Location
Indeed, this is a bug - but why would you need to do this?
You talk about passing a reference to the "variable" - but
myint isn't variable (except perhaps in a mathematical sense)
- it's a constant. Just pass the constant.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list