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

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
Feedback 👍
Comments are sent via email to me.