Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21105
| From | Xah Lee <xahlee@gmail.com> |
|---|---|
| Newsgroups | comp.lang.lisp, comp.lang.python, comp.lang.perl.misc |
| Subject | Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp |
| Date | 2012-03-01 14:04 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <8e769add-e63c-4a74-bb7e-ddd36c04a415@vs5g2000pbc.googlegroups.com> (permalink) |
| References | <85fa5760-68c8-41a2-9116-2489165f7ca1@j5g2000yqm.googlegroups.com> <jin5fp03os@enews1.newsguy.com> <20120229231658.89@kylheku.com> <wkv4d38we76f.fsf@runa.se> <20120301064937.505@kylheku.com> |
Cross-posted to 3 groups.
On Mar 1, 7:04 am, Kaz Kylheku <k...@kylheku.com> wrote: lisp: (floor (/ x y)) --[rewrite]--> (floor x y) Thanks for this interesting point. I don't think it's a good lang design, more of a lang quirk. similarly, in Python 2.x, x/y will work when both x and y are integers. Also, x//y works too, but that // is just perlish unreadable syntax quirk. similarly, in perl, either one require POSIX; floor(x/y); the require POSIX instead of Math is a quirk. But even, floor should really be builtin. or using a perl hack int(x/y) all of the above are quirks. They rely on computer engineering by- products (such as int), or rely on the lang's idiosyncrasy. One easy way to measure it is whether a programer can read and understand a program without having to delve into its idiosyncrasies. Problem with these lang idioms is that it's harder to understand, and whatever advantage/optimization they provide is microscopic and temporary. best is really floor(x/y). idiomatic programing, is a bad thing. It was spread by perl, of course, in the 1990s. Idiomatic lang, i.e. lang with huge number of bizarre idioms, such as perl, is the worst. Xah
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
lang comparison: in-place algorithm for reversing a list in Perl, Python, Lisp Xah Lee <xahlee@gmail.com> - 2012-02-29 20:07 -0800
Re: lang comparison: in-place algorithm for reversing a list in Perl, Python, Lisp Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-01 05:01 +0000
Re: lang comparison: in-place algorithm for reversing a list in Perl, Python, Lisp Xah Lee <xahlee@gmail.com> - 2012-02-29 21:39 -0800
Re: Re: lang comparison: in-place algorithm for reversing a list in Perl, Python, Lisp Evan Driscoll <driscoll@cs.wisc.edu> - 2012-03-01 00:07 -0600
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp "WJ" <w_a_x_man@yahoo.com> - 2012-03-01 06:37 +0000
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-03-01 22:14 +0000
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp Xah Lee <xahlee@gmail.com> - 2012-03-01 14:04 -0800
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp Chris Angelico <rosuav@gmail.com> - 2012-03-02 18:11 +1100
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp Xah Lee <xahlee@gmail.com> - 2012-03-02 03:30 -0800
Re: lang comparison: in-place algorithm for reversing a list in Perl, Python, Lisp Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-03-01 14:39 +0000
Re: lang comparison: in-place algorithm for reversing a list in Perl,Python, Lisp "WJ" <w_a_x_man@yahoo.com> - 2012-03-02 07:17 +0000
csiph-web