On Thu, May 28, 2009 at 1:37 AM, Daniel Carrera <daniel.carr...@theingots.org> wrote: > Hi Damian, > > This is a really good list. Mind if I copy it / modify it and post it > somewhere like my blog? One question: > >> * Compactness of expression + semi-infinite data structures: >> >> �...@fib = 1,1...&[+] # The entire Fibonacci sequence > > Very impressive. That's even shorter than Haskell. What's &[+] ? How does > this work? In Haskell:
Start with the addition operator, '1 + 1'. Apply the reducing metaoperator to it so that it works syntactically like a function: '[+] 1, 1'. Instead of calling it, pass a code reference to it: '&[+]'. The lazy list then uses that function to extend the list as needed. What I'm wondering is how the list knows to feed two items into '[+]'. While 'infix:<+>' must accept exactly two arguments, '[+]' can accept an arbitrarily long (or short) list of arguments. -- Jonathan "Dataweaver" Lang