Re: Who needs types if we have terms?
- From: "tmp123" <tmp123@xxxxxxxxx>
- Date: 26 May 2005 00:33:11 -0700
Hi Brian,
Only two small comments/questions. I expect do not annoy posting again
in this subject.
Brian Hulley wrote:
> Perhaps it's easier to understand in a language like ML:
>
> type Exp = Number of int | Plus of Exp * Exp;;
>
Yes, I agree. I used "number" to do not add a new word. But seems
better:
result(exp(number(X)),X).
result(exp(plus(exp(X),exp(Y))),Z) :- ...
(however, it mix types and constructors).
>
> You might like to try Ocaml http://caml.inria.fr (a modern version of ML which is free and can run on Windows) to gain more clarity about
> types.
You have read my mind. After the question about prolog and image
processing (no answers), I've made a fast analysis of the existing
languages (existing=existing in www), and decided to use "ocaml".
However, one advantage of prolog is, in my opinion, that concepts
appears more clear. In fact, it is posible to be an excellent C++
programmer, and do not have any idea about the basis of a "type", a
"template", or what is an invariant. I suposse it is related to the
fact that C++ appears like a "closed" packet (a lot of things, but use
it as it is).
(Another advantage of prolog is the prolog group is very active, with
very colaborative persons).
Thanks again.
.
- References:
- Who needs types if we have terms?
- From: tmp123
- Re: Who needs types if we have terms?
- From: Brian Hulley
- Re: Who needs types if we have terms?
- From: tmp123
- Re: Who needs types if we have terms?
- From: Brian Hulley
- Who needs types if we have terms?
- Prev by Date: Re: Prolog for beginners.
- Next by Date: Re: interpreter?
- Previous by thread: Re: Who needs types if we have terms?
- Next by thread: interpreter?
- Index(es):
Relevant Pages
|
|