Here's a neat test of programming language expressiveness: Can you write a function PrintXY taking an integer n>=0 that prints all strings of length n containing only the characters 'X' and 'Y'? Can you do it without recursion, and without assuming n<=64? Is it readable?
-
-
The power here comes from the compositionality of choice, failure, and backtracking to drive looping, searching, and collection formation instead of mutable variable updates or Haskell style higher order functions (sugared by comprehensions).
-
Is it syntactic sugar? No: Even though very simple cases are optimizable down to ordinary loops, the ability to introduce backtrack points, to unify, and fail is can be completely dynamic.
End of conversation
New conversation -
-
-
ok so how would you change the output from a list of YN-words to a single Y / N per line?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.