Learning PROLOGUE
1
Name:
Anonymous
2009-05-20 23:49
Good PROLOGUE books, please. I read S&A.
2
Name:
Anonymous
2009-05-21 0:01
3
Name:
Anonymous
2009-05-21 0:27
4
Name:
Anonymous
2009-05-21 0:36
product([], 1).
product([H|T], X) :- product(T, Y), X is H * Y.
factorial(N, R) :- numlist(2, N, Ns), product(Ns, R).
that's all you need to know.
5
Name:
Anonymous
2009-05-21 0:43
6
Name:
Anonymous
2009-05-21 1:35
Bump for PROLOGUE books. Please don't tell me to google, I don't trust Google.
7
Name:
Anonymous
2009-05-21 2:19
>>6
You don't trust Google, but you trust
/prog/ ? OK..................
8
Name:
Anonymous
2009-05-21 2:22
>>7
Google doesn't find S&A. You gave me S&A. I enjoyed it.
9
Name:
Anonymous
2009-05-21 3:28
>>8
I can assure you, Google has in fact found S&A, it is you who was unable to find it. What you should be saying is "I am incapable of finding things myself and would prefer it for
/prog/ to find it for me."
10
Name:
Anonymous
2009-05-21 3:43
11
Name:
Anonymous
2009-05-21 4:23
PROLOGUE is obsolete. Learn EPILOGUE instead.
12
Name:
Anonymous
2009-05-21 5:18
13
Name:
Anonymous
2009-05-21 5:22
What is this PROLOGUE crap? Learn Lisp you plebes.
14
Name:
Anonymous
2009-05-21 9:43
15
Name:
Anonymous
2009-05-21 9:49
>>13
I know LISP, I read S&A.
16
Name:
Anonymous
2009-05-21 9:58
17
Name:
Anonymous
2009-05-21 10:32
>>16
I posted the link as proof that google didn't find me S&A. I tried many queries but none did.
18
Name:
Anonymous
2009-05-21 20:09
>>5
twofibs(0, 1, 0).
twofibs(N, F1, F0) :-
atomic(N), N > 0,
Q is N >> 1, R is N /\ 1, twofibs(Q, A, B),
X is A * A + B * B, Y is B * (A << 1 + B),
( R =:= 0 -> F1 is X, F0 is Y; F1 is Y, F0 is X + Y ).
fib(N, F) :-
A is abs(N),
S is sign(N),
R is N /\ 1,
twofibs(A, _, F0),
((S =:= -1, R =:= 0) -> F is -F0; F is F0).
and here's a prime sieve for you:
:- use_module(library(chr)).
:- chr_constraint prime/1.
prime(X) \ prime(Y) <=> 0 is Y mod X | true.
primes(1). primes(N) :- prime(N), succ(M,N), primes(M).
>>13
lisp has been obsolete for almost 40 years.
19
Name:
Anonymous
2009-05-21 20:17
ONE WORD, THE FORCED USE OF is FOR ARITHMETIC, THREAD OVER
20
Name:
Anonymous
2009-05-21 20:24
>>19
Despite the fact that C wasn't invented yet
21
Name:
Anonymous
2009-05-21 20:31
22
Name:
Anonymous
2009-05-21 20:49
>>21
It's a syntax error to write PROLOGUE while not implementing an expert system or an AI
23
Name:
Anonymous
2009-05-21 20:53
>>22
Just like it's a syntax error to write LISP while not eating oatmeal with toenail clippings in it?
24
Name:
Anonymous
2009-05-21 22:30
>>18
[b] Lisp:
[b] making all other languages obsolete for 50 years.
25
Name:
Anonymous
2009-05-21 23:45
>>24
LISP has been obsolete since
1972 .
26
Name:
Anonymous
2009-05-21 23:49
27
Name:
Anonymous
2009-05-21 23:59
>>25
actually, it's been obsolete since
1958.
28
Name:
Anonymous
2009-05-22 4:42
>>26
Rhymes with ''glass femurs´´.
29
Name:
Anonymous
2009-05-22 17:10
scheme : obsolete for 7 years before it was created.
30
Name:
Anonymous
2009-05-22 17:12
LISP and Scheme weren't created. They were discovered .
31
Name:
Anonymous
2009-05-22 19:31
>>30
Scheme was created in 1975 by LISPers who were butthurt about Forth, Prolog, and ML all being more functional than LISP.
32
Name:
Anonymous
2009-05-22 19:38
What's up with all the good languages appearing in 1972-1973 anyway? C, Forth, ML, Prolog, SASL...
33
Name:
Anonymous
2009-05-22 19:40
>>31
butthurt
Back to /b/, please.
34
Name:
Anonymous
2009-05-23 0:17
>>33
is butthurt because
>>31 speaks the truth.
35
Name:
Anonymous
2009-05-23 0:31
>>34
No. Because that's a /b/-esque word and both you and
>>31 should head back there.
36
Name:
Anonymous
2009-05-23 0:50
>>35
the word „butthurt“ has been around a lot longer than /b/ has.
>>33,35 should take his non-functional language back to /pr/.
37
Name:
Anonymous
2009-05-23 1:13
>>36
IHBT.
/pr/ discusses PHP and Java. Get out.
38
Name:
Anonymous
2009-05-23 1:47
C++ is a functional programming langauge. It's working and capable of getting stuff done. (LISP isn't functional)
39
Name:
Anonymous
2009-05-23 2:14
>>38
One word functions are not first class thread over.
40
Name:
Anonymous
2009-05-23 2:16
>>38
Only for certain definitions of ``working''. Sepples is
designed to trip you up.
Newer Posts