[clean-list] Re: Class restriction to 32

shivkumar chandrasekaran shiv@ece.ucsb.edu
13 Jun 2003 09:07:07 -0700


> No, keep 32 as a the maximum number of fields in a record. Although it 
> might work correctly in small examples for larger records (by accident).
> 
> Have fun,
> 
> Pieter Koopman


My problem is not that I *explicitly* create records or classes with
more than 32 entries in them. Rather it is the fact that I have lots of
classes, more than 32, and I write functions that utilize more than 32
of these classes, mostly indirectly. Clean 1.3 used to barf on such
cases. My question is, does this continue to be the case in 2.0?

This is not an idle question. I already have an interface to LAPACK and
BLAS in OCaml, that lets me write a single code that works in real
double, real single, complex double and complex single precisions. In
OCaml I achieve this by using functors. Since Clean does not have
functors, I am trying to achieve the same thing by using classes. Is
there any other way to do this?

Thanks for your time.

--shiv--

PS: Let me try to build a mock example here of what I mean:

class ci t		}
instance ci Real	} where i goes from 1 to 100 say
instance ci Complex	}

Then I define some utility functions

fun_i _ _ _ | ci_1, ci_2, ... ci_10

And suppose there are 50 such utility functions, all of which depend on
10 classes individually.

Now suppose I build my big function

g _ _ _ | fun_1, fun_2, fun_3, fun_4, fun_5

Now g indirectly depends on more than 32 class members. In 1.3 I
remember this being a problem. Will this work in 2.0? If not, is there a
way around it?