Icon+Unicon/Intro: Difference between revisions

Content added Content deleted
Line 61: Line 61:


=== Data Types ===
=== Data Types ===

The following summarizes the data types of Icon and Unicon. Each type is described and its characteristics are noted:
* mutable or immutable - changeable or not
* coercible or not - coercion is implicit type conversion by operations
* convertible or not - convertible through explicit type conversion

==== &null ====
==== &null ====
&null is unique. It is a data type with only a single value, one instance only. While this may sound odd at first, &null is at the core of Icon/Unicon and contributes to the power and robustness of the language. Specifically, &null arose to overcome a short coming that any [[SNOBOL4]] programmer will be familiar with. Consider the following SNOBOL code:
&null (immutable, uncoercible, unconvertable) is unique. It is a data type with only a single value, one instance only. While this may sound odd at first, &null is at the core of Icon/Unicon and contributes to the power and robustness of the language. Specifically, &null arose to overcome a short coming that any [[SNOBOL4]] programmer will be familiar with. Consider the following SNOBOL code:


<lang Snobol> numb1 = 2
<lang Snobol> numb1 = 2