Re: Who needs types if we have terms?



"tmp123" <tmp123@xxxxxxxxx> writes:

> Or, in other words, is a term a data type?. They are usually used like
> data types?
> Because I've read a lot of post about prolog typed/untyped, but I'm
> wondering me if the only diference is in type (term) checking.

"Data type" can mean a lot of things, and you could describe the set
of terms with a given main functor as a data type. That Prolog is
untyped means that predicates (with a few exceptions) can be applied
to any terms. Thus for example append/3, although a predicate intended
to be used only with lists, can be called with any arguments, and
there is no checking, either at compile time or at runtime, of the
form of the arguments.
.



Relevant Pages

  • Re: Lisp collections
    ... Obviously, in my sentence above, "lists" must be understood differently! ... THE abstract data type I HAVE IN MIND. ... ones provided by Common-Lisp, if at all. ...
    (comp.lang.lisp)
  • Re: SoA Vs OO
    ... data type, they are just functions that operate on a data type, and if ... When doing functional design, you start with what you want done. ... mostly it's lists and trees (there isn't much need felt ... so the subclass can't even access it. ...
    (comp.object)
  • Re: SoA Vs OO
    ... data type, they are just functions that operate on a data type, and if ... When doing functional design, you start with what you want done. ... mostly it's lists and trees (there isn't much need felt ... so the subclass can't even access it. ...
    (comp.programming)
  • Re: Lisp collections
    ... do you think Lisp has a data type called a number? ... > that CONS,CAR,CDR,NULL implement the PAIR abstract data type. ... Your claim that "Lisp does not have lists" does not follow logically ...
    (comp.lang.lisp)
  • Re: Lisp collections
    ... because you have a bug in your remove-at! ... data type as representing your list abstract data ... lists, you would not try to implement them with cons since: ... --> NIL! ...
    (comp.lang.lisp)