location on define-constant

Chuah Teong Leong teongleong@gmail.com
Mon Aug 6 07:40:00 GMT 2012


Yes you're right Per, an after thought seem to suggest that.
Thanks. So location useful when we want to set that variable, a
constant can just be passed by value.



On Mon, Aug 6, 2012 at 3:18 PM, Per Bothner <per@bothner.com> wrote:
> 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