Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

The elephant sized new feature of ZPE 1.10.4

Exceptional Elephant brings a big new feature that really makes the new version more powerful than ever. 

ZPE had for a long time relied heavily on using by value passing of variables to functions, both internal and externally, and this became even more confusing when the new reference types came to ZPE (aka ZPETypes). For example, the list_add_element function would actually modify the original list passed into it, whereas other functions would simply copy the list and change it. No longer do any of these predefined functions copy the value passed but will always modify the version passed to it.

So, passing by reference is very important. But then so is passing by value. Now you can specify this by running list_add_element(&$l) to pass by reference, passing the original list through or by value by simply writing list_add_element($l). It's also important to note that with any programming language and runtime, and not just YASS, that passing by reference is considerably faster.

I've been wanting to this feature into ZPE for a good few years but it was tricky. Since ZPETypes have been included it's been much clearer to me that it was easy enough to do.

Posted in General
Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.

Comments powered by BalfComment

Powered by DASH 2.0