Man' I've been left quite far.
@Leledumbo
That does require quite a different mindset than I am used to. Is that more about Haskell, or functional programming in general?
Which one? Lazy evaluation is somewhat tied to functional programming, but not all functional programming languages implement it. Meanwhile, it's possible to implement it in imperative language, but will not look as natural as in functional language. e.g.: this is a function returning infinite list of fibonacci numbers:
very clear that if you implement it blindly in imperative programming, it will only result in infinite recursion, right? Due to lazy evaluation, you can indeed do the infinite recursion, or:
first10FibonacciNumbers
= take 10 fibs
and first10FibonacciNumbers will be a list of first 10 fibonacci numbers. I'll leave it up to you how in imperative language this should be done.
I just watched a short video on lambda calculus, the way they presented a function, a black box with input and output, is how I normally try to write a function.
Yes, as how it's defined in math. The blackbox, however, is not a series of command or steps to produce output based on input, but an expression, just like in math. And expression is the core of functional programming. As I've shown previously, not all functions will be compiled into functions in assembly. They can be eliminated completely or simplified as far as possible even into a simple value assignment only (if the function call can be executed at compile time).
I guess anonymous functions are another significant piece of it though. Apparently in Delphi, but not in Free Pascal yet?
WIP and partially working in trunk, AFAIK. Or is it still in separate branch?