Not Lisp again....
funcall.blogspot.com
funcall.blogspot.com
And almost makes me want to invest in SICP or something similar to see what all this LISP-talk is about :)
http://mitpress.mit.edu/sicp/full-text/book/book.html
If you meant an investment of time, then, well yes. But SICP is really, really fun.
I don't like reading entire books on the computer. It just feels better on paper ;)
Does anyone who feels the same have a kindle? Supposedly the screen is more like paper. Wondering how well that works...
(The killer feature of the Kindle, though, is the effortless buying feature. When you have to pay $30 and go to the store or wait 5 days for shipping, you tend to not buy books. When you can click a button and start reading on a paper-like screen instantly, it becomes much easier to read all the books that you've been "meaning to" read. But I digress.)
The best 20-hour introduction to CS you can find, or your money back!
SICP couldn't be worth any more if it were printed on gold leaf, but having Abelson and Sussman there to teach it really seals the deal.
?- append([1, 2, 3], [4, 5, 6], X).
X = [1, 2, 3, 4, 5, 6].
?- append([1, 2, 3], X, [1, 2, 3, 4, 5, 6]).
X = [4, 5, 6].
?- append(X, [4, 5, 6], [1, 2, 3, 4, 5, 6]).
X = [1, 2, 3].
And the definition of append: append([], X, X).
append([X | Y], Z, [X | O]) :- append(Y, Z, O).
Magic!It means the tools you write for one use can be used completely differently than you intended, and in ways that continue to give you those "whoa!" moments.
An extremely (imho) good source for information on logic programs and how they are implemented is here: http://www.ida.liu.se/~ulfni/lpp/
A more practical guide to actually compiling these logic programs efficiently (or as efficient as they can be) is documented in Modern Compiler Design by Dick Grune et al. They actually describe the workings of a somewhat simplified workings of a Warren Abstract Machine (WAM) which can (to my knowledge) now approach to within an order of magnitude of standard programming languages. Pretty amazing when the generality of logic programming is considered. Details on the WAM here: http://en.wikipedia.org/wiki/Warren_Abstract_Machine
3 + 5 = X?
X = 8
3 + X = 8?
X = 5
5 + X = 8?
X = 3
In most programming languages, you can't infer a parameter by specifying a result.
(Though that's not strictly what's going on here, either)
You could further say something like X + Y = 8 and get
X = 0, Y = 8
X = 1, Y = 7
etc. for some definitions.
Which is, as the OP was getting at, sometimes incredibly useful.
If you're asking "is there anything in the wild that I would know of and uses this?" then the answer is probably "no".
Most of the prolog projects I've ever seen are pretty inbred; implementing compilers or interpreters, hooks for another language-type things. Though it must be said that I'm not deeply embedded in the prolog community.
Prolog, where you just type what you want to achieve, and it goes ahead and does it for you. I really couldn't wrap my head around it for some time. I read up on backtracking and chased around derivations on paper to satisfy myself that something like append really worked.
Anyway if you are interested I'd love to hear from you, my email is: idoh@idoh.com
<code> dx = .000001
def deriv(f): def fprime(x): return (f(x+dx) - f(x))/dx return fprime
def cube(x): return x3
def printDeriv(x): print (deriv(cube))(x) print 3x*2
printDeriv(5) </code>
that he also put 'harder to understand' and 'capability' in the list is confusing. he must mean capability in some kind of raw sense, whereas i see capability as having abstraction and libraries so i can get to the meat faster. again, abstraction is usually easier to understand.
perhaps when meat is speed and efficiency then our perspectives merge. psyched about 16 Mb of RAM!
btw, scheme has recently been replaced by python in the intro programming courses. snap.