Jamie Balfour

Welcome to my personal website.

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

Official ZPE/YASS documentationIs Set

The ZPE is_set feature has been included as a YASS language keyword since ZPE 1.12.4. Prior to this it was a predefined function which can be found here.

is_set determines if a variable has already been defined locally, globally or as a parameter. This is particularly useful for determining if an optional parameter has been defined. This will provide a boolean value.

Using is_set

The is_set feature works like a function syntactically but it differs in it's implementation.

YASS
$a = 10
print(is_set($a))
$b = {a : 15}
print(is_set($b->a))
        

Unlike prior versions, is_set cannot be used on pure values and must be used on expressive values.

Before becoming a keyword

Prior to is_set becoming a language keyword, the is_set was a function. Part of the design philosophy behind making a keyword was to make execution faster as it was a widely used function but whilst maintaining compatibility with existing scripts.

The is_set function is one of the oldest functions in ZPE. You can read more about it here.

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.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.