Forum: Legacy and Other Languages Mar 4th, 2009 |
| Replies: 5 Views: 1,429 All you need to do to fix your problem is look at your code and imagine what a prolog interpreter would do when interpreting it. |
Forum: Legacy and Other Languages Mar 3rd, 2009 |
| Replies: 5 Views: 1,429 Well you have more problems than just that. |
Forum: Legacy and Other Languages Mar 2nd, 2009 |
| Replies: 5 Views: 1,429 Your second predicate is going to match and override whatever you do in your third predicate. You need to handle nested lists before you handle non-nested lists. |
Forum: Legacy and Other Languages Feb 3rd, 2009 |
| Replies: 4 Views: 839 No, it says you have non-exhaustive patterns!
In particular, you defined the function binadd for non-empty lists with:
binadd (x:xs) (y:ys) n = ...
But you didn't define the function for... |
Forum: Legacy and Other Languages Feb 2nd, 2009 |
| Replies: 4 Views: 839 d2b2 evaluates to something of type [Int], right? Which means the expression (d2b2(n / 2):1) is trying to pass an [Int] as the left-hand argument of the (:) function. Since the (:) function is of... |
Forum: Legacy and Other Languages Dec 19th, 2008 |
| Replies: 2 Views: 873 This is a complete waste of your time. |
Forum: Legacy and Other Languages Nov 15th, 2008 |
| Replies: 2 Views: 973 awk '{ system("kill " $2) }' |
Forum: Legacy and Other Languages Nov 26th, 2007 |
| Replies: 15 Views: 3,077 Well, yeah. I agree with calling functions (when used functionally in Scheme) functions. And calling procedures (when used procedurally, with side effects) procedures.
Of course, Scheme isn't... |
Forum: Legacy and Other Languages Nov 24th, 2007 |
| Replies: 15 Views: 3,077 There are no functions in Scheme, only procedures. That is, the word used in the R5RS specification (and probably R6RS, but I haven't read that) is "procedure". That's why there is a procedure... |