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: Handling Bindings for Perl variables


[Someone from perljvm-hackers noted that the discussion here might be of
 interest to people on perljvm-hackers, since we are specifically discussing
 issues for perljvm.  Those of you on perljvm-hackers may want to read the
 backlog of threads about Perl on the kawa list.  Those of you on the kawa
 list, please follow up to perljvm-hackers, too, and I'll make sure your
 posts go through (although you may get one "held for approval" message).
 Thanks.]

Per Bothner <per@bothner.com> wrote:

> That seems a better alternative, but I'd have to understand better what
> typelobs are and how they are used.  Just the "*a = *b" operation is
> certainly easy enough to do as three seprate operations.

There are some other typeglob oddities, but they are rare and specific
enough, that it'll be striaght-foward to compile them on a case-by-case
basis.  I think there is likely no sense in the extra layer of indirection
just to make typeglob operations easier, since they are so rare.

In fact, rumor is typeglobs are slated to disappear in Perl6.

> > Could I perhaps help generalize what is there?
> 
> Why do you need to?  At least for scalar variables, can't you
> use Binding as is?

It looks like I probably can, although, as you mentioned, it may be
necessary to make some specialized Constraints for things like tied
variables.
> 
> > This sounds like a good idea.  I am curious, though, how to handle both
> > lexicals as well as globals this way.
 

>   A Binding may be created if you "take its address"
> (make a reference to it) - but I don't know if Perl lets you create
> a reference to a lexical. 

Yes, it certainly does allow references to variables and closures.  Despite
gossip to the contrary, Perl is a Real Language (TM).  ;)


> In any case, Kawa handles lexical variables (and closures) automatically,
> normally without creating a Binding.

That's good, so we may not likely need to use Bindings (at least directly)
to handle lexicals and references to lexicals.  However, since lexicals can
be tied as well, we'll have to at least use bindings for that.

 
> I am in the middle of changing Kawa so all variables references get bound
> to Declaration.  If there is no lexical Declaration, one is created that
> has the IS_UNKNOWN flag.  So note there will be some changes here in the
> next few days (I hope - it could easily take longer!).

Ok, keep us posted.  ;)

-- 
Bradley M. Kuhn  -  http://www.ebb.org/bkuhn

PGP signature


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