News for hackers. Stuff that matters.
Re:Racket is 25 by ookdatnog on Sunday May 10, 2020 @01:03PM (#23134150)
As far as I (not a Prolog expert) know, your Prolog is idiomatic. But it is more declarative than your Haskell or Scheme implementations: you didn't just define a concat function, but a concat relation, which means you can use it in many more ways. Here are just a few examples from the top of my head.

- The head function (with X unknown and L known): concat([X],_,L).

- Produce all splits of a list (with X and Y unknown): concat(X,Y,L).

- Does this list start with the prefix [a,b]? If yes, let Y be the tail (Y unknown): concat([a,b],Y,L).

... and many more.

Re:Racket is 25 by mturmon on Sunday May 10, 2020 @04:36PM (#23135944)
This is one of the most magical things about Prolog.

From my functional/imperative programming experience, when originally picking up Prolog, I conceptualized the kind of operations you describe (e.g., “all splits”) as “running the function backwards” — going from output L to inputs X, Y.

But as you write, the truth is that Prolog is modeling the relation of concatenation.