:= — Prologue

My current long-term project for Rakudo is currently the bind operator (:=). They serve the function of references or pointers in other languages; it allows a second variable to point to the same address in memory*.

So all I’d have to do is, for $b := $a, get the location of $a (accessible in P6 with $a.WHERE), and set the location of $b to that same spot, right? Well, it’s not that easy. $b.WHERE = $a.WHERE doesn’t work, because WHERE is understandably a readonly value. So, that means I have to get into the NQP and PIR of Rakudo.

So I’m currently attempting to find how the variable is created and then create infix:<:=> to do what infix:<=> does, but in a slightly different way. The guts of Rakudo aren’t being very nice to me, so I have to keep on searching :/

*See http://use.perl.org/~masak/journal/40246 for a better explanation of binding.

This entry was posted in Research Department and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s