This is the mail archive of the kawa@sources.redhat.com 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]

Re: [KAWA] -> Java


Chris <chrisb@nimrod.itg.telstra.com.au> writes:

> I see that the default way that Kawa translates a module field into Java
> is this...
> 
>  public final Binding foo =
> Environment.getCurrent().getBinding("ticker");
> 
> There must be some reason why it does this as opposed to simply
> 
> public Object foo ....
> 
> but I can't see what it is.

One reason is that would make it more-or-less impossible to implement
correct Scheme sematics.  (What if multiple source files define
the same variable, which is legal?)

However, if you declare an explicit type, you get a simple fields:

(define foo :: <object> #!null)

A lot of this information is in the Kawa reference manual.
It is admittedly tough reading, but I think worth it.

> Also, why does it make it "final"?

Because it is - when it's indirected via a Binding.  (The actual value
stored in the Binding is not final, though.)
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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