List Info

Thread: Re: "ocaml_beginners"::[] Re: mixed value hashtable




Re: "ocaml_beginners"::[] Re: mixed value hashtable
country flaguser name
United States
2007-06-05 17:19:46

mo.deeq wrote:
> ingenious method Robert, but sadly i allow users to define their own
> types ..however, i'm sure i will find that definition somewhere

Perhaps you should give some examples of user defined types and we can
show you how to apply Robert's method to these types.

You're currently storing variables as strings. If you can store them as
strings, then we can create a variant type for you that will be cleaner
and more efficient than your current system.

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] Re: mixed value hashtable
country flaguser name
United States
2007-06-05 17:37:21

--- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, Karl Zilles <zilles...> wrote:
&gt;
> mo.deeq wrote:
&gt; > ingenious method Robert, but sadly i allow users to define their own
> > types ..however, i'm sure i will find that definition somewhere
>
> Perhaps you should give some examples of user defined types and we can
> show you how to apply Robert's method to these types.
&gt;
> You're currently storing variables as strings. If you can store
them as
> strings, then we can create a variant type for you that will be cleaner
> and more efficient than your current system.
>

Hi Karl, your probably right i'm still caml-naive, anyhow,
definitions are fairly simple have the form

my_type my_var = my_value

i.e.

int a = 1 ;
char v = "v&quot;;
foo bar = foobar

where the only 1 constraint that object on the left and right hand
side of the assignment *must* be of the same type and as such the type
of a variable must be know before it can be used in an assignment, so
that a user is able to write code such as

foo foobar = ..;

foo bar = foobar;

the types and assignments are defined by the user of the language as
and when required in their program, i don't enforce any specific
constraints.

i hope that makes more sense. thanks again

deeq

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )