Jump to content

Add a variable to a class instance at runtime: Difference between revisions

m
m (→‎{{header|Falcon}}: formatting)
Line 118:
 
=={{header|Falcon}}==
Classes and singleton objects have a fixed structure which cannot be changed during runtime. However falcon does have capability to add variables/functions at runtime with Prototype based objects. Below are two of the prototype objects that allow adding variables at runtime. These are arrays and dictionaries (hashes for the perl type out there).<br><br>
 
'''Array:'''
In this example we add a function (which prints out the content of the array) and a new value. While we are not technically adding a "variable", this example is presented to show similar type of functionality.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.