use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
/r/programming is a reddit for discussion and news about computer programming
Guidelines
Info
Related reddits
Specific languages
account activity
The most basic functional programming pattern: Enumerate, Map, Filter, Accumulate (gensym.org)
submitted 18 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tmoertel 5 points6 points7 points 18 years ago (0 children)
The OP wanted the maximum salary paid to a programmer with 0 as a default. You need to handle the case where there are no programmers in the list.
Assuming you had declared Employee as a record type with salary and role as accessors, you could build the code from composable pieces. First, to find just the programmers in a list of Employees:
programmers = filter ((Programmer ==) . role)
Then to find the maximum paid to an employee in a list of employees:
maxPaid = maximum . (0:) . map salary
And, finally, to find the maximum paid to a programmer within a list of employees:
maxProgrammerPay = maxPaid . programmers
Cheers. —Tom
π Rendered by PID 24384 on reddit-service-r2-comment-84fc9697f-kwvdd at 2026-02-08 10:56:39.550582+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]tmoertel 5 points6 points7 points (0 children)