3

I'm completely stuck on a problem to write a function that does NOT use recursion, locals, or lambda. Only abstract list functions can be used. The function must input a list of positive integers, and output a list of integers that are strictly greater than 1.

any ideas on how to do this? I've never implemented abstract list functions on their own and I'm not sure which ones would be used in this case. Also, the language setting is Intermediate Student, no higher.

E 4 6
  • 31
  • 1
  • Yes I'm aware of that. but I have no idea what predicate I'd use when applying Filter – E 4 6 Nov 11 '14 at 13:56
  • If you don't have a `>1` predicate, you can define one; and if you're not allowed to use `lambda` either, maybe you can use `curry` instead. – Kilian Foth Nov 11 '14 at 13:58
  • Is there a >1 predicate used? like would (filter >1 lst) work? – E 4 6 Nov 11 '14 at 14:23
  • Maybe I have it: use the functions `-1+`, `positive?`, `1+` with `map`, `filter`, and `map`. – Giorgio Nov 11 '14 at 14:43
  • `1+` and `-1+` seem to be only in MIT-scheme (http://stackoverflow.com/questions/24228642/increment-and-decrement-operators-in-scheme-programming-language) – Giorgio Nov 11 '14 at 14:53

0 Answers0