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.

5
  • Yes I'm aware of that. but I have no idea what predicate I'd use when applying Filter
    – E 4 6
    Commented Nov 11, 2014 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. Commented Nov 11, 2014 at 13:58
  • Is there a >1 predicate used? like would (filter >1 lst) work?
    – E 4 6
    Commented Nov 11, 2014 at 14:23
  • Maybe I have it: use the functions -1+, positive?, 1+ with map, filter, and map.
    – Giorgio
    Commented Nov 11, 2014 at 14:43
  • 1+ and -1+ seem to be only in MIT-scheme (stackoverflow.com/questions/24228642/…)
    – Giorgio
    Commented Nov 11, 2014 at 14:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.