[perl-python] 20050117, filter, map

X

Xah Lee

© # -*- coding: utf-8 -*-
© # Python
©
© # the "filter" function can be used to
© # reduce a list such that unwanted
© # elements are removed.
© # example:
©
© def even(n): return n % 2 == 0
© print filter( even, range(11))
©
©
© # the "map" function applies a function
© # to all elements of a list. Example:
©
© def square(n): return n*n
© print map(square, range(11))
©
© ------------------------------------
© # similar perl versions
©
© use Data::Dumper;
© sub even {return $_[0]%2==0};
© print Dumper[ grep {even $_} (0..10)];
©
©
© # sub square {$n=shift;$n**2;};
© sub square {(shift)**2;};
© print Dumper [ map {square($_)} (0..10)];
©
© # the codes above showcase some syntax
© # variations commonly found in perl code
© # base
©
© -------------------------
©
© # in Mathematica for example, filter is
© # akin to Apply and map is MapThread.
© # The standard Map can be applied
© # according to a level spec of trees
© # and there's also MapAt, Nest,
© # NestList...any many more powerful
© # functions that manipulates trees.
© # lisp languages often have a subset
© # of it.
©
© ----------------------------
© Note: this post is from the Perl-Python
© a-day mailing list at
© http://groups.yahoo.com/group/perl-python/
© to subscribe, send an email to
© (e-mail address removed) if
© you are reading it on a web page,
© program examples may not run because
© html conversion often breaks the code.
©
© Xah
© (e-mail address removed)
© http://xahlee.org/PageTwo_dir/more.html
 
E

Erik Max Francis

Steven said:
Is there any chance you could post these all as part of the same thread?
That would be really nice for those of us who aren't interested --
then we could just ignore the thread...

Or, better yet, not posting it at all. He's got his mailing list, what
does he need to post it here for?
 
S

Steve Holden

You are looking for evidence of cluefulness where it seems unlikely to
ever appear.
Or, better yet, not posting it at all. He's got his mailing list, what
does he need to post it here for?
As I may have mentioned before, egotism can be the only possible reason.

regards
Steve
 
N

Nick Coghlan

Steve said:
As I may have mentioned before, egotism can be the only possible reason.

I'd merely figured it as a textbook case of trolling - attention seeking
behaviour, most likely indicative of a lack of self-esteem, rather than the reverse.

Still, he does at least keep the [perl-python] mailing list tag, so automatic
filtering isn't that difficult. It is an unfortunate shame that his
consideration doesn't extend to removing the general Perl and Python discussion
groups from his recipients list.

Cheers,
Nick.
 
M

Martin Kissner

Steven Bethard wrote :
Is there any chance you could post these all as part of the same thread?
That would be really nice for those of us who aren't interested --
then we could just ignore the thread...

I would appreciate that, too.
But I fear this person doesn't even read the comments on his unwanted
load.

I guess I'll scorefile the "Subject" of these postings, too, to get rid of
this.
 
A

Abigail

Steven Bethard ([email protected]) wrote on MMMMCLVII September
MCMXCIII in <URL:$$ Xah Lee wrote:
$$ > © Note: this post is from the Perl-Python
$$ > © a-day mailing list at
$$ > © http://groups.yahoo.com/group/perl-python/
$$
$$ Is there any chance you could post these all as part of the same thread?


Just killfile him, and stop replying. Remember, don't feed the trolls.



Abigail
 
C

Charlton Wilbur

SH> As I may have mentioned before, egotism can be the only
SH> possible reason.

Relevant links:

"On Ignoring Trolls":
http://www.xahlee.org/UnixResource_dir/writ/troll_ignorance.html
"A Troll's Anthology":
http://www.xahlee.org/UnixResource_dir/writ/troll_anthology.html

He admits to being a troll, and he enjoys trolling. I suspect this
thread was intended to stir up a flame war among Perl and Python
users; all it's done is demonstrate how hopeless Xah is as a
programmer even in a language he claims to be an expert in.

Charlton
 
J

Jürgen Exner

Abigail said:
Steven Bethard ([email protected]) wrote on MMMMCLVII September
$$ Is there any chance you could post these all as part of the same
thread?

Just killfile him, and stop replying. Remember, don't feed the trolls.

True, except that he spreads lies about Perl and really bad code all over
the place.
If you don't tell people about how awful his skills are then they may
actually mistake his incompetency for flaws in Perl.

jue
 
T

Tad McClellan

Erik Max Francis said:
Or, better yet, not posting it at all. He's got his mailing list, what
does he need to post it here for?


There isn't much point in trolling if you don't have an audience.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top