Re: Who needs types if we have terms?



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.

.



Relevant Pages

  • Re: Mainstreaming Prolog a Pragmatic Approach?
    ... experience is that Prolog is an incredibly useful language for virtually all ... often than not end up using Prolog. ... I think you're right when you question whether logic programming really ...
    (comp.lang.prolog)
  • Re: An even more basic question...
    ... My task was to represent these rules in Prolog, and to write an engine which, given a client's total position, could find the way of pairing its components so as to satisfy the rules with the minimum total margin requirement. ... present-day ISO Prolog is not co-extensive with the concept of Prolog -- and Prolog is not a "language" is the abusive sense in which that term is misapplied to deterministic stepwise-imperative computing notations. ... TOPIC: PROGRAMMING ... adapted to your particular scheduling problem, ...
    (comp.lang.prolog)
  • Re: An even more basic question...
    ... relatively recent standardization of prolog, how come the prolog community, ... applicable as a standalone language for product development. ... for example - noone expects SQL to ... programming language, and in time more sophisticated operational ...
    (comp.lang.prolog)
  • Re: Minsky still posting
    ... >> they seem to me significant features of its own. ... > the functiomal langauges than used with Prolog. ... operator in an imperative language. ... > part of the logic programming core of Prolog. ...
    (comp.lang.prolog)
  • Re: Mainstreaming Prolog a Pragmatic Approach?
    ... What you can do in one language, you can do in another, one ... So that's no more unique to Prolog than anything else. ... Sure you can implement depth-first backtracking in C, ... language I would choose to use for any significant piece of programming. ...
    (comp.lang.prolog)