type_io.icl 16.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
implementation module type_io


import DebugUtilities;

import StdEnv, compare_constructor // ,RWSDebug

import scanner, general, Heap, typeproperties, utilities, checksupport

class WriteTypeInfo a 
where
	write_type_info :: a !*File -> !*File
	
instance WriteTypeInfo CommonDefs
where 
	write_type_info {com_type_defs,com_cons_defs} tcl_file
		# tcl_file
			= write_type_info com_type_defs tcl_file
		# tcl_file
 			= write_type_info com_cons_defs tcl_file
		= tcl_file
	
instance WriteTypeInfo ConsDef
where 
	write_type_info {cons_symb,cons_arg_vars,cons_priority,cons_index,cons_type_index,cons_exi_vars} tcl_file
		# tcl_file
			= write_type_info cons_symb tcl_file
		# tcl_file
			= write_type_info cons_arg_vars tcl_file
		# tcl_file
			= write_type_info cons_priority tcl_file

		# tcl_file
			= write_type_info cons_index tcl_file
		# tcl_file
			= write_type_info cons_type_index tcl_file
		# tcl_file
			= write_type_info cons_exi_vars tcl_file
	
		= tcl_file
		
PrioCode	=: toChar 0
NoPrioCode	=: toChar 1

instance WriteTypeInfo Priority
where 
	write_type_info (Prio assoc i) tcl_file
		# tcl_file
			= fwritec PrioCode tcl_file
		# tcl_file
			= write_type_info assoc tcl_file
		# tcl_file
			= write_type_info i tcl_file
		= tcl_file
	write_type_info NoPrio tcl_file
		# tcl_file
			= fwritec NoPrioCode tcl_file
		= tcl_file
		
LeftAssocCode	=: toChar 2
RightAssocCode	=: toChar 3
NoAssocCode		=: toChar 4
		
instance WriteTypeInfo Assoc
where 
	write_type_info LeftAssoc tcl_file
		# tcl_file
			= fwritec LeftAssocCode tcl_file
		= tcl_file

	write_type_info RightAssoc tcl_file
		# tcl_file
			= fwritec RightAssocCode tcl_file
		= tcl_file	

	write_type_info NoAssoc tcl_file
		# tcl_file
			= fwritec NoAssocCode tcl_file
		= tcl_file	
		
instance WriteTypeInfo TypeDef TypeRhs
where 
	write_type_info {td_name,td_arity,td_args,td_rhs} tcl_file
 		#! tcl_file
 			= write_type_info td_name tcl_file
		#! tcl_file
 			= write_type_info td_arity tcl_file
 		#! tcl_file
 			= write_type_info td_args tcl_file
		#! tcl_file
 			= write_type_info td_rhs tcl_file
 		= tcl_file
 		
instance WriteTypeInfo ATypeVar
where 
	write_type_info {atv_annotation,atv_variable} tcl_file
 		#! tcl_file
 			= write_type_info atv_annotation tcl_file
 		#! tcl_file
 			= write_type_info atv_variable tcl_file
 		= tcl_file
 		
instance WriteTypeInfo Annotation
where 
	write_type_info AN_Strict tcl_file	
		= fwritec '!' tcl_file
	write_type_info AN_None tcl_file
		= fwritec ' ' tcl_file
		
instance WriteTypeInfo TypeVar
where
	write_type_info {tv_name} tcl_file
		= write_type_info tv_name tcl_file
		
AlgTypeCode			=: (toChar 5)
SynTypeCode 		=: (toChar 6)
RecordTypeCode		=: (toChar 7)
AbstractTypeCode	=: (toChar 8)

instance WriteTypeInfo TypeRhs
where 
	write_type_info (AlgType defined_symbols) tcl_file
 		#! tcl_file
 			= fwritec AlgTypeCode tcl_file;
		
		# tcl_file
			= write_type_info defined_symbols tcl_file

		= tcl_file
		
	write_type_info (SynType _) tcl_file
		#! tcl_file
 			= fwritec SynTypeCode tcl_file;
 			
 		// unimplemented
 		= tcl_file 
		
	write_type_info (RecordType {rt_fields}) tcl_file
 		#! tcl_file
 			= fwritec RecordTypeCode tcl_file;
		= write_type_info rt_fields tcl_file

	write_type_info (AbstractType _) tcl_file
 		#! tcl_file
 			= fwritec AbstractTypeCode tcl_file;
 			
 		// unimplemented
		= tcl_file
		
instance WriteTypeInfo DefinedSymbol 
where
	write_type_info {ds_ident,ds_arity,ds_index} tcl_file
		# tcl_file
			= write_type_info ds_ident tcl_file
		# tcl_file
			= write_type_info ds_arity tcl_file
		# tcl_file
			= write_type_info ds_index tcl_file
		= tcl_file

instance WriteTypeInfo Ident 
where
	write_type_info {id_name} tcl_file
//		# tcl_file
//			= fwritei (size id_name) tcl_file
//		= fwrites id_name tcl_file
		= write_type_info id_name tcl_file;
		
instance WriteTypeInfo FieldSymbol
where
	write_type_info {fs_name,fs_var,fs_index} tcl_file
		# tcl_file
			= write_type_info fs_name tcl_file
		# tcl_file
			= write_type_info fs_var tcl_file
		# tcl_file
			= write_type_info fs_index tcl_file
		= tcl_file
			
// basic and structural write_type_info's
instance WriteTypeInfo Int 
where
	write_type_info i tcl_file
		= fwritei i tcl_file

instance WriteTypeInfo {#b} | select_u, size_u, WriteTypeInfo b 
where
	write_type_info unboxed_array tcl_file
		# s_unboxed_array
			= size unboxed_array
		# tcl_file
			= fwritei s_unboxed_array tcl_file
			
		= write_type_info_loop 0 s_unboxed_array tcl_file
	where 
		write_type_info_loop i limit tcl_file
			| i == limit
				= tcl_file
			# tcl_file
				= write_type_info unboxed_array.[i] tcl_file
			= write_type_info_loop (inc i) limit tcl_file
			
instance WriteTypeInfo [a] | WriteTypeInfo a
where
	write_type_info l tcl_file
		# tcl_file
			= fwritei (length l) tcl_file
		= write_type_info_loop l tcl_file
	where
		write_type_info_loop []	tcl_file
			= tcl_file
		write_type_info_loop [x:xs] tcl_file
			# tcl_file
				= write_type_info x tcl_file
			= write_type_info_loop xs tcl_file
			
instance WriteTypeInfo Char
where
	write_type_info c tcl_file
		# tcl_file
			= fwritec c tcl_file;
		= tcl_file;
	
	
// read
class ReadTypeInfo a
where
	read_type_info :: !*File -> (!Bool,a,!*File)
	
instance ReadTypeInfo CommonDefs
where
	read_type_info tcl_file
		# (ok1,com_type_defs,tcl_file)
//			= (True,{},tcl_file);
			= read_type_info tcl_file
		# (ok2,com_cons_defs,tcl_file)
			= (True,{},tcl_file);
//			= read_type_info tcl_file
			
		# common_defs
			= { CommonDefs |
				com_type_defs		= com_type_defs
			,	com_cons_defs		= com_cons_defs
			,	com_selector_defs	= {}
			,	com_class_defs		= {}
			,	com_member_defs		= {}
			,	com_instance_defs	= {}
			}
		= (ok1&&ok2,common_defs,tcl_file)

instance ReadTypeInfo TypeDef TypeRhs
where
	read_type_info tcl_file
		
		// td_name
		#! (ok1,td_name,tcl_file)
			= read_type_info tcl_file
		| F ("TypeDef '" +++ td_name.id_name +++ "'") not ok1
			= (False,default_elem,tcl_file)
			
		// td_arity
		#! (ok2,td_arity,tcl_file)
			= read_type_info tcl_file
		| not ok2
			= (False,default_elem,tcl_file)

		// td_args
		#! (ok2,td_args,tcl_file)
			= read_type_info tcl_file
		| not ok2
			= (False,default_elem,tcl_file)

		// td_rhs
		#! (ok2,td_rhs,tcl_file)
			= read_type_info tcl_file
		| not ok2
			= (False,default_elem,tcl_file)
	
		# type_def
			= { default_elem &
				td_name 	= td_name
			,	td_arity	= td_arity
			,	td_args		= td_args
			,	td_rhs		= td_rhs
			}
		
		= (ok1,type_def,tcl_file)

instance ReadTypeInfo TypeRhs
where
	read_type_info tcl_file
		# (ok1,c,tcl_file)
			= freadc tcl_file
		| not ok1
			= (False,default_elem,tcl_file)
			
		| c == AlgTypeCode
			# (ok,defined_symbols,tcl_file)
				= read_type_info tcl_file
			= (ok,AlgType defined_symbols,tcl_file)
			
		| c == SynTypeCode
			= (True,UnknownType,tcl_file)
		| c == RecordTypeCode
			= (True,UnknownType,tcl_file)
		| c == AbstractTypeCode
			= (True,UnknownType,tcl_file)
			
instance ReadTypeInfo Priority
where
	read_type_info tcl_file
		# (ok1,p,tcl_file)
			= freadc tcl_file
		| not ok1
			= (False,default_elem,tcl_file)
			
		| p == PrioCode
			# (ok1,assoc,tcl_file)
				= read_type_info tcl_file
			# (ok2,i,tcl_file)
				= read_type_info tcl_file
			
			# prio
				= Prio assoc i
			= (ok1&&ok2,prio,tcl_file)	
			
		| p == NoPrioCode
			= (ok1,NoPrio,tcl_file)
			
instance ReadTypeInfo Assoc
where
	read_type_info tcl_file
		# (ok1,a,tcl_file)
			= freadc tcl_file
		| not ok1
			= (False,default_elem,tcl_file)	
			
		| a == LeftAssocCode
			= (ok1,LeftAssoc,tcl_file)
		| a == RightAssocCode
			= (ok1,RightAssoc,tcl_file)
		| a == NoAssocCode
			= (ok1,NoAssoc,tcl_file)
						
instance ReadTypeInfo DefinedSymbol
where
	read_type_info tcl_file
		// ds_ident
		# (ok1,ds_ident,tcl_file)
			= read_type_info tcl_file
		| not ok1
			= (False,default_elem,tcl_file)
			
		// ds_arity
		# (ok2,ds_arity,tcl_file)
			= read_type_info tcl_file
		| not ok2
			= (False,default_elem,tcl_file)
		
		// ds_index
		# (ok3,ds_index,tcl_file)
			= read_type_info tcl_file
		
		# defined_symbol
			= { default_elem &
				ds_ident	= ds_ident
			,	ds_arity	= ds_arity
			,	ds_index	= ds_index
			}
		= (ok3,defined_symbol,tcl_file)
		

instance ReadTypeInfo ConsDef 
where
	read_type_info tcl_file
		# (ok1,cons_symb,tcl_file)
			= read_type_info tcl_file
		# (ok2,cons_arg_vars,tcl_file)
			= read_type_info tcl_file
		# (ok3,cons_priority,tcl_file)
			= read_type_info tcl_file

		# (ok4,cons_index,tcl_file)
			= read_type_info tcl_file
		# (ok5,cons_type_index,tcl_file)
			= read_type_info tcl_file
		# (ok6,cons_exi_vars,tcl_file)
			= read_type_info tcl_file
			
		# consdef
			= { default_elem &
				cons_symb			= cons_symb
			,	cons_arg_vars		= cons_arg_vars
			,	cons_priority		= cons_priority
			
			,	cons_index			= cons_index
			,	cons_type_index		= cons_type_index
			,	cons_exi_vars		= cons_exi_vars
			}
		= (ok1&&ok2&&ok3&&ok4&&ok5&&ok6,consdef,tcl_file)
		
instance ReadTypeInfo Char
where
	read_type_info :: !*File -> (!Bool,Char,!*File)
	read_type_info tcl_file
		= freadc1 tcl_file
	where
		//	Input. The boolean output parameter reports success or failure of the operations.
		
		freadc1::!*File -> (!Bool,!Char,!*File)
		/*	Reads a character from a text file or a byte from a datafile. */
		freadc1 f
			= code {
				.inline freadc
				.d 0 2 f
					jsr	readFC
				.o 0 4 b c f
				.end
			}
/*
		# (_,i,tcl_file)
			= freadi tcl_file

		# (q,tcl_file)
			= freads tcl_file i;


		| True
			= abort ("dkskksdkdsksdkfklsklklsgfdklsdgfklgklklgklgkl " +++ toString q);
	*/			

instance ReadTypeInfo Ident
where 
	read_type_info :: !*File -> (!Bool,Ident,!*File)
	read_type_info tcl_file

/*
		# (ok1,id_name,tcl_file)
			= read_type_info tcl_file
*/		
		# (ok1,i,tcl_file)
			= freadi tcl_file

		
		# (id_name,tcl_file)
			= freads tcl_file i;
		| F ("Ident " +++ toString i +++ " - " +++ id_name) True
		
			
		
		# ident
			= { default_elem &
				id_name		= id_name
			,	id_info		= nilPtr
			}
		= (ok1,ident,tcl_file)

instance ReadTypeInfo ATypeVar
where
	read_type_info tcl_file
		// atv_annotation
		# (ok1,atv_annotation,tcl_file)
			= read_type_info tcl_file
		| not ok1
			= (False,default_elem,tcl_file)
			
		// atv_variable
		# (ok2,atv_variable,tcl_file)
			= read_type_info tcl_file
		| not ok2
			= (False,default_elem,tcl_file)
			
		# atypevar
			= { default_elem &
				atv_annotation	= atv_annotation
			,	atv_variable	= atv_variable
			}
		= (True,atypevar,tcl_file)
		
instance ReadTypeInfo TypeVar
where
	read_type_info tcl_file
		# (ok1,tv_name,tcl_file)
			= read_type_info tcl_file
		
		# typevar
			= { default_elem &
				tv_name		= tv_name
			}
		= (ok1,typevar,tcl_file)
			
instance ReadTypeInfo Annotation
where
	read_type_info tcl_file
		#! (ok1,c,tcl_file)
			= freadc tcl_file
		
		# annotation
			= if (c == '!') AN_Strict AN_None
		= (ok1,annotation,tcl_file)
		
// basic and structural write_type_info's
instance ReadTypeInfo Int
where 
	read_type_info :: !*File -> (!Bool,Int,!*File)
	read_type_info tcl_file
		= freadi_new tcl_file
	where
		// copy from StdEnv. The only difference is the dot before the Int in the type
		// of freadi_new.
		freadi_new ::!*File -> (!Bool,!Int,!*File)
		/*	Reads an integer from a textfile by skipping spaces, tabs and newlines and
			then reading digits, which may be preceeded by a plus or minus sign.
			From a datafile freadi will just read four bytes (a Clean Int). */
		freadi_new f		
			= code {
				.inline freadi
				.d 0 2 f
					jsr	readFI
				.o 0 4 b i f
				.end
			}
			
	
instance ReadTypeInfo {#b} | ReadTypeInfo b & DefaultElem b & ArrayElem b //| DefaultElem,  createArray_u, select_u, size_u, update_u, ReadTypeInfo b
where 
	read_type_info tcl_file

		# (ok,s_unboxed_array,tcl_file)
			= freadi tcl_file
		| F ("s_unboxed_array: " +++ toString s_unboxed_array) not ok
			= (False,{default_elem},tcl_file)
			
		# unboxed_array
			= { default_elem \\ i <- [1..s_unboxed_array] }
		= read_type_info_loop 0 s_unboxed_array tcl_file unboxed_array

	where
		read_type_info_loop i limit tcl_file unboxed_array
			| F ("  " +++ toString i) i == limit
				= (True,unboxed_array,tcl_file)
				
			# (ok,elem,tcl_file)
				= read_type_info tcl_file
			| not ok
				= (False,unboxed_array,tcl_file)
				
				= read_type_info_loop (inc i) limit tcl_file {unboxed_array & [i] = elem}
	
		
instance ReadTypeInfo [a] | ReadTypeInfo a
where
	read_type_info tcl_file
		# (ok1,limit,tcl_file)
			= freadi tcl_file
		| not ok1
			= (False,[],tcl_file)
			
		= read_type_info_loop 0 limit tcl_file []
	where
		read_type_info_loop i limit tcl_file elems
			| i == limit
				= (True,reverse elems,tcl_file)
				
			# (ok,elem,tcl_file)
				= read_type_info tcl_file
			| not ok 
				= (False,[],tcl_file)
				= read_type_info_loop (inc i) limit tcl_file [elem:elems]
				
		

		
	
// defaults
class DefaultElem a
where
	default_elem :: a
	
instance DefaultElem (TypeDef TypeRhs)
where 	
	default_elem
	 	= { TypeDef |
	 		td_name			= default_elem
		,	td_index		= default_elem
		,	td_arity		= default_elem
		,	td_args			= default_elem
		,	td_attrs		= default_elem
		,	td_context		= default_elem
		,	td_rhs			= default_elem
		,	td_attribute	= default_elem
		,	td_pos			= default_elem
		}

//		= abort "aa";
		
instance DefaultElem Position
where
	default_elem
		= NoPos
		
instance DefaultElem TypeAttribute
where
	default_elem
		= TA_None
		
instance DefaultElem TypeRhs
where
	default_elem
		= UnknownType
		
instance DefaultElem ATypeVar
where
	default_elem
		= {	ATypeVar |
			atv_attribute		= TA_None
		,	atv_annotation		= AN_None
		,	atv_variable		= default_elem
		}	

instance DefaultElem TypeVar
where
//	default_elem :: TypeVar
	default_elem
		= { TypeVar |
			tv_name				= default_elem
		,	tv_info_ptr			= default_elem
		}
	
/*	
instance DefaultElem Ptr TypeVarInfo
where
	default_elem
		= nilPtr
*/

instance DefaultElem (Ptr a) // | DefaultElem a
where
	default_elem
		= nilPtr //default_elem
		
instance DefaultElem Ident
where 
	default_elem
		= { Ident |
		 	id_name		= {}
		,	id_info 	= default_elem
		}
		
		
instance DefaultElem TypeVarInfo
where
	default_elem
		= TVI_Empty
		
instance DefaultElem SymbolTableEntry
where
	default_elem
		= { SymbolTableEntry |
			ste_kind		= STE_Empty
		,	ste_index		= NoIndex
		,	ste_def_level	= NotALevel
		,	ste_previous	= abort "instance DefaultElem SymboltableEntry"
		}
		
instance DefaultElem [a]
where
	default_elem
		= []
		
instance DefaultElem Int
where
	default_elem
		= abort "instance DefaultElem Int"
		
instance DefaultElem DefinedSymbol
where
	default_elem
		= { DefinedSymbol |
			ds_ident		= default_elem
		,	ds_arity		= default_elem
		,	ds_index		= default_elem
		}
		
instance DefaultElem ConsDef
where
	default_elem
		= { ConsDef |
			cons_symb			= default_elem
		,	cons_type			= default_elem
		,	cons_arg_vars		= default_elem
		,	cons_priority		= default_elem
		,	cons_index			= default_elem
		,	cons_type_index		= default_elem
		,	cons_exi_vars		= default_elem
		,	cons_type_ptr		= default_elem
		,	cons_pos			= default_elem
		}

instance DefaultElem Priority
where
	default_elem
		= NoPrio
		
instance DefaultElem SymbolType
where
	default_elem
		= { SymbolType |
			st_vars			= [] //default_elem
		,	st_args			= [] //default_elem
		,	st_arity		= 0 //default_elem
		,	st_result		= default_elem
		,	st_context		= [] //default_elem
		,	st_attr_vars	= [] //default_elem
		,	st_attr_env		= [] //default_elem
		}		

instance DefaultElem VarInfo
where
	default_elem
		= VI_Empty
		
instance DefaultElem AType
where
	default_elem
		= { AType |
			at_attribute	= default_elem
		,	at_annotation	= default_elem
		,	at_type			= default_elem
		}

instance DefaultElem Type
where
	default_elem
		= TE
		
instance DefaultElem Annotation
where
	default_elem
		= AN_None
		
instance DefaultElem Assoc
where
	default_elem
		= NoAssoc
			

/*
instance DefaultElem CommonDefs
where
	default_elem
		= { CommonDefs |
			com_type_defs 		= default_elem
		,	com_cons_defs		= default_elem
		,	com_selector_defs	= undef //default_elem
		,	com_class_defs		= undef
		,	com_member_defs		= undef
		,	com_instance_defs	= undef
		}			
*/		

/*
instance DefaultElem ClassInstance
where
	default_elem
		= {	ClassInstance |
			ins_class		= default_elem 
		,	ins_ident		= default_elem
		,	ins_type		= default_elem
		,	ins_members		= default_elem
		,	ins_specials	= default_elem
		,	ins_pos			= default_elem
		}
	*/	
		
/*
instance DefaultElem SelectorDef
where
	default_elem
		= { SelectorDef |
			sd_symb			= default_elem
		,	sd_field		= default_elem
		,	sd_type			= default_elem
		,	sd_exi_vars		= default_elem
		,	sd_field_nr		= default_elem
		,	sd_type_index	= default_elem
		,	sd_type_ptr		= default_elem
		,	sd_pos			= default_elem
		}		
*/			

instance DefaultElem {#a}	| ArrayElem, DefaultElem a
where
	default_elem
		= {default_elem}