Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
rrwo
on Oct 31, 2022
|
parent
|
context
|
favorite
| on:
Ask HN: What piece of code/codebase blew your mind...
A lot of code from The Art of Prolog that used some form of accumulator data structure as a third argument to predicates.
Jtsummers
on Nov 1, 2022
[–]
Do you mean something like how you might define `append/3`
append([], L, L). append([H|T], L2, [H|L3]) :- append(T, L2, L3).
Such that the computation can be run in any direction? Where it will produce the result of appending two lists, or the prefixes and suffixes of a list if the result (third parameter) is known, and so on?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: