Index: trunk/archive/pslib/include/psMath.h
===================================================================
--- trunk/archive/pslib/include/psMath.h	(revision 204)
+++ trunk/archive/pslib/include/psMath.h	(revision 206)
@@ -83,2 +83,30 @@
 
 /** for a set of N data types, you need a collection of N^2 - 1 functions **/
+
+/*** example 3: embedded data type */
+
+psImage A, B, Y;
+
+B = psBinaryOp (NULL, A, "^", psScalar(2));
+Y = psUnaryOp (NULL, B, "log");
+
+/** in this method, the data types (psImage, psVector) include embedded information about their data type in
+ * the structure.  The constant value is then handled by calling the psScalar function which returns a private
+ * scalar data type which is always freed by the code.  This forces the layout of the data structures to be
+ * consistent, with the type information as the first entry.  We can then define a data type which is
+ * completely flat and can be used to check on the data type of the data.
+ */
+
+typedef struct {
+    psTypeInfo type;
+    union {
+	int i;
+	float f;
+	double d;
+    }
+} p_psScalar;
+
+typedef struct {
+    psType type;
+    psDimension dim;
+} psTypeInfo;
