Jump to content

Talk:Declarative programming

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 2.100.99.88 (talk) at 21:32, 6 July 2023 (Prolog example: Reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Vital article

WikiProject iconComputing C‑class High‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
HighThis article has been rated as High-importance on the project's importance scale.
WikiProject iconComputer science C‑class Top‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
TopThis article has been rated as Top-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

vandalism

In the page-preview for the first mention of "SQL" — Preceding unsigned comment added by 142.161.137.88 (talk) 23:32, 12 June 2019 (UTC)[reply]

lisp and sml aren't declarative

lisp is imperative and sml is functional

this article reads like it's been lifted from a seo blogspam 206.191.44.34 (talk) 14:32, 25 July 2022 (UTC)[reply]

Prolog example

The given example doesn't work as expected. Ordinary Prolog doesn't admit higher-order predicates, which are, however, used at e.g. cat(tom). along with animal(cat). I'm not sure whether the example can be fixed, or needs to be replaced. - Jochen Burghardt (talk) 14:28, 30 June 2023 (UTC)[reply]

I came up with a version that I could get running in the expected way:

cat(tom).
mouse(jerry).

animal(X) :-
        cat(X).
animal(X) :-
        mouse(X).

big(X) :-
        cat(X).
small(X) :-
        mouse(X).

eat(X,Y) :-
        mouse(X),
        cheese(Y).
eat(X,Y) :-
        big(X),
        small(Y).

After loading that code, the query eat(tom,jerry). will succeed, while e.g. eat(jerry,tom). will fail. However, I can't align this new code with the current pseudo-linguistic fuss about "set theory facts", "adjective facts ", and "relationships", which I suspect to be at best WP:OR, anyway. If there is no objection, I'll replace the example by just the bare code above. - Jochen Burghardt (talk) 14:15, 3 July 2023 (UTC)[reply]

Please replace the psuedo-Prolog code by correct Prolog.
How did it get there? And how long has it been there? Shocking! 2.100.99.88 (talk) 21:32, 6 July 2023 (UTC)[reply]