732Re: "ocaml_beginners":: Re: Generating codes/values
- Jan 15, 2003"spooky_jesse <spooky_jesse@...>" <spooky_jesse@...> writes:
> --- In email@example.com, Remi VANICATWell, of course, when you need a tree, you have to define it, but,
> <vanicat+egroups@l...> wrote:
>> "spooky_jesse <spooky_jesse@y...>" <spooky_jesse@y...> writes:
>> 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.
> Yes, but it's surely better to define a tree as
> type 'a tree =
> Node of 'a tree * 'a * 'a tree
> | Empty
when you need list, you should use those of the stdlib.
the type :
type 'a code =
End of 'a
| Code of 'a * 'a code;;
is not a tree, but a list.
- << Previous post in topic Next post in topic >>