This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: location on define-constant


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]