764Re: "ocaml_beginners":: Re: Generating codes/values
- Jan 19, 2003On Mon, Jan 13, 2003 at 11:23:29AM +0100, Remi VANICAT wrote:
> "spooky_jesse <spooky_jesse@...>" <spooky_jesse@...> writes:With compilation units/modules I may internally use
> > I haven't spent a lot of time thinking about your problem but the
> > first thing that popped into my mind was why use a list when you can
> > define your own type (recursively if need be)?
> because, generally speaking, it's better to use already define
> data-structure when you can : it's more readable and there are some
> function in the stdlib for them.
my own data type, but give back a list of lists. :)
Are self defined types a perfromance issue?
(It will not be critically in my application,
but interests me in genral.)
But back to my question about how to create such a list:
When doing that job in functional manner, it seems
to me the best, to first create all partial lists,
and then put them together.
Or maybe I can create these lists on the fly?
Maybe a recursive function with two parameters: one for the
state of the current digit, I work on, and one for the number
of the digiut I work on?
Or is it a better approach to use arrays instead of lists,
and maybe switch back to imperative programming for such a problem?
- << Previous post in topic Next post in topic >>