Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #8691 > unrolled thread
| Started by | rantingrick <rantingrick@gmail.com> |
|---|---|
| First post | 2011-07-02 15:59 -0700 |
| Last post | 2011-07-03 13:21 +1000 |
| Articles | 20 on this page of 64 — 14 participants |
Back to article view | Back to comp.lang.python
The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 15:59 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 09:38 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 16:46 -0700
Re: The end to all language wars and the great unity API to come! Tim Chase <python.list@tim.thechases.com> - 2011-07-02 20:09 -0500
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 17:21 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 10:36 +1000
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 16:06 +1200
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 17:58 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 11:12 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 18:43 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 11:49 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 19:24 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 13:14 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:13 -0700
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 19:08 -0700
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 15:57 +1200
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:34 -0700
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-03 14:46 +1000
Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-03 02:59 -0700
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 16:00 +1200
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:42 -0700
Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-03 22:06 -0700
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-04 09:35 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-05 03:19 +1000
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-05 09:24 +1000
Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-04 19:09 -0700
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 18:07 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 12:31 +1000
Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 23:13 -0500
Re: Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT) Chris Angelico <rosuav@gmail.com> - 2011-07-06 14:25 +1000
Re: Microsoft GUIs Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 23:53 -0500
Re: Microsoft GUIs Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 00:29 -0500
Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-05 22:26 -0700
Re: Microsoft GUIs Chris Angelico <rosuav@gmail.com> - 2011-07-06 15:43 +1000
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 15:47 +1000
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 19:15 +1200
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:46 +1000
Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-06 09:55 -0700
Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-04 19:31 -0700
Re: The end to all language wars and the great unity API to come! sal migondis <salmig99@gmail.com> - 2011-07-05 11:14 -0700
Re: The end to all language wars and the great unity API to come! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 16:01 -0500
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 08:36 +1000
Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-05 22:26 -0700
Re: The end to all language wars and the great unity API to come! Ben Finney <ben+python@benfinney.id.au> - 2011-07-07 15:10 +1000
Re: The end to all language wars and the great unity API to come! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 00:37 -0500
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:45 +1000
Re: The end to all language wars and the great unity API to come! sal migondis <salmig99@gmail.com> - 2011-07-08 12:05 -0700
Re: The end to all language wars and the great unity API to come! Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-08 13:21 -0600
Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-04 19:36 -0700
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-04 19:36 +1200
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 04:42 -0700
Re: The end to all language wars and the great unity API to come! Corey Richardson <kb1pkl@aim.com> - 2011-07-05 12:04 -0400
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 15:35 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 08:49 +1000
Re: The end to all language wars and the great unity API to come! Tim Chase <python.list@tim.thechases.com> - 2011-07-05 18:21 -0500
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:44 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-06 06:41 -0700
Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 23:52 +1000
Re: The end to all language wars and the great unity API to come! Neil Cerutti <neilc@norwich.edu> - 2011-07-06 15:13 +0000
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-07 00:55 +1000
Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-06 08:33 -0700
Re: The end to all language wars and the great unity API to come! Teemu Likonen <tlikonen@iki.fi> - 2011-07-06 19:55 +0300
Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 19:05 +1200
Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-03 13:21 +1000
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | Andrew Berg <bahamutzero8825@gmail.com> |
|---|---|
| Date | 2011-07-05 16:01 -0500 |
| Message-ID | <mailman.654.1309899732.1164.python-list@python.org> |
| In reply to | #8848 |
On 2011.07.05 01:14 PM, sal migondis wrote: > How could a belief be wrong? Beliefs aren't subjective. One's taste in music, for example, is largely subjective and can't be right or wrong, but a belief (which has to do with facts) certainly can be. > > > What do you think will be the eventual outcome of the human existence > > > Alex? Since you have no imagination i will tell you, a singular > > > intelligence. > > All from the land of creationism. That's from rantingrick, not alex23. > > No need to answer that last one, we already know the answer: from the > > very beginning. > > In the beginning was a singularity... and Albert Einstein was a chain- > smoker. Either you're taking that statement out of context, or you're making an esoteric joke. If it's not the latter, I suggest you read the sentence before it.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2011-07-06 08:36 +1000 |
| Message-ID | <mailman.661.1309905418.1164.python-list@python.org> |
| In reply to | #8848 |
On Wed, Jul 6, 2011 at 4:14 AM, sal migondis <salmig99@gmail.com> wrote: > On Jul 4, 10:31 pm, alex23 <wuwe...@gmail.com> wrote: >> rantingrick <rantingr...@gmail.com> wrote: >> > What do you think will be the eventual outcome of the human existence >> > Alex? Since you have no imagination i will tell you, a singular >> > intelligence. > > All from the land of creationism. I don't see the connection between creationism and a Borg-like "singularity of intelligence" where we all lose individuality. But this is now decidedly off-topic for a Python mailing list. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2011-07-05 22:26 -0700 |
| Message-ID | <mailman.680.1309929985.1164.python-list@python.org> |
| In reply to | #8848 |
On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg
<bahamutzero8825@gmail.com> declaimed the following in
gmane.comp.python.general:
> On 2011.07.05 01:14 PM, sal migondis wrote:
> > How could a belief be wrong?
> Beliefs aren't subjective. One's taste in music, for example, is
> largely subjective and can't be right or wrong, but a belief (which has
> to do with facts) certainly can be.
Pardon????
Most "beliefs" that I've encountered do their best to ignore any
facts that contradict the belief. "Facts" imply testable evidence,
hypotheses, eventual theorems...
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2011-07-07 15:10 +1000 |
| Message-ID | <87r562iskf.fsf@benfinney.id.au> |
| In reply to | #8894 |
Dennis Lee Bieber <wlfraed@ix.netcom.com> writes: > On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg > <bahamutzero8825@gmail.com> declaimed the following in > gmane.comp.python.general: > > > On 2011.07.05 01:14 PM, sal migondis wrote: > > > How could a belief be wrong? > > Beliefs aren't subjective. One's taste in music, for example, is > > largely subjective and can't be right or wrong, but a belief (which > > has to do with facts) certainly can be. > > Pardon???? By “has to do with facts”, I understand Andrew to be saying that a belief is *about* facts. That is, a belief is the position that a factual claim is true. > Most "beliefs" that I've encountered do their best to ignore any > facts that contradict the belief. You seem to be ignoring beliefs that are not usually held dogmatically: that the sun will rise tomorrow, that the newspaper article one is reading is likely true, that one's lunch is not poison, etc. These are distinct from so-called “beliefs” that are really opinions: that my daughter is the loveliest in the world, that wasabi is horrible, etc. > "Facts" imply testable evidence, hypotheses, eventual theorems... I'd say facts are claims about reality which have been independently verified to be true. Beliefs that are about facts are thereby correct or incorrect. -- \ “Only the educated are free.” —Epictetus, _Discourses_ | `\ | _o__) | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Andrew Berg <bahamutzero8825@gmail.com> |
|---|---|
| Date | 2011-07-06 00:37 -0500 |
| Message-ID | <mailman.684.1309930688.1164.python-list@python.org> |
| In reply to | #8848 |
On 2011.07.06 12:26 AM, Dennis Lee Bieber wrote: > On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg > <bahamutzero8825@gmail.com> declaimed the following in > gmane.comp.python.general: > > > On 2011.07.05 01:14 PM, sal migondis wrote: > > > How could a belief be wrong? > > Beliefs aren't subjective. One's taste in music, for example, is > > largely subjective and can't be right or wrong, but a belief (which has > > to do with facts) certainly can be. > > Pardon???? > > Most "beliefs" that I've encountered do their best to ignore any > facts that contradict the belief. "Facts" imply testable evidence, > hypotheses, eventual theorems... I didn't say people were objective. A belief is quite similar to a statement of fact. Whether the statement is true or false or even objectively reached isn't relevant to the definition.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-07-06 21:45 +1000 |
| Message-ID | <4e144add$0$29982$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #8848 |
sal migondis wrote: > How could a belief be wrong? I believe you are a small glass of beer. Are you *actually* a small glass of beer in reality? If so, my belief is right. If you are a human being, then my belief is wrong. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | sal migondis <salmig99@gmail.com> |
|---|---|
| Date | 2011-07-08 12:05 -0700 |
| Message-ID | <d6f33e67-aa4a-40aa-856c-b38ece4ceda3@m18g2000vbl.googlegroups.com> |
| In reply to | #8930 |
On Jul 6, 7:45 am, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > sal migondis wrote: > > How could a belief be wrong? > I believe... Shifting from 'belief' to 'believe', the latter having a considerably wider semantic scope. After that, anything goes.. naturally. > you are a small glass of beer. Are you *actually* a small glass of > beer in reality? If so, my belief is right. If you are a human being, then > my belief is wrong. Are you a lawyer..? Sal.
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2011-07-08 13:21 -0600 |
| Message-ID | <mailman.783.1310152898.1164.python-list@python.org> |
| In reply to | #9090 |
On Fri, Jul 8, 2011 at 1:05 PM, sal migondis <salmig99@gmail.com> wrote: >> I believe... > > Shifting from 'belief' to 'believe', the latter having a considerably > wider semantic scope. Wider how? Would you care to give an example of something that is believed but is not a belief?
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2011-07-04 19:36 -0700 |
| Message-ID | <4fb6c152-0bb5-4497-b182-14518f18d5eb@s33g2000prg.googlegroups.com> |
| In reply to | #8775 |
rantingrick <rantingr...@gmail.com> wrote: > CREATING THE BEST LANGUAGE WE CAN AT ANY ONE > TIME IN HISTORY... Incidentally, Umberto Eco's "The Search for the Perfect Language" pretty readily exposes this desire as a lingering vestige of the Biblical belief in the one true language that was spoken by God. It also covers in some depth the persistent failure to ever create such a language. Fools, history, rinse & repeat.
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2011-07-04 19:36 +1200 |
| Message-ID | <97d8spFg2nU1@mid.individual.net> |
| In reply to | #8725 |
rantingrick wrote: > I agree however i see merit in both approaches. But why must we have > completely different languages just for that those two approaches? We have different languages because different people have different ideas about what a language should be like. Ruby people like user defined control structures; Python people regard user defined control structures as an anti-feature. It's fundamentally impossible for one language to satisfy both sets of people. -- Greg
[toc] | [prev] | [next] | [standalone]
| From | rantingrick <rantingrick@gmail.com> |
|---|---|
| Date | 2011-07-05 04:42 -0700 |
| Message-ID | <22a13bda-899d-4765-a03c-f8a36efaf905@34g2000yqr.googlegroups.com> |
| In reply to | #8757 |
On Jul 4, 2:36 am, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote: > We have different languages because different people have different > ideas about what a language should be like. Ruby people like user > defined control structures; Python people regard user defined > control structures as an anti-feature. It's fundamentally > impossible for one language to satisfy both sets of people. I was thinking more about this comment and it occurred to me that Python does have user controlled data structures. Just because there is no "top level syntax" like ruby does not mean these do not exists. You only have to look below the surface. Take the sort methods of lists for example... >>> lst = [ (100, 0), (25, 2), (10,1), ] >>> lst [(100, 0), (25, 2), (10, 1)] >>> lst.sort() >>> lst [(10, 1), (25, 2), (100, 0)] >>> lst.sort(lambda x,y: cmp(x[1], y[1])) >>> lst [(100, 0), (10, 1), (25, 2)] ...that looks like a "user defined control" structure to me. So how can an anti-feature become part of the language proper? (devils advocate here) :) I leave the discovery of other user defined control structures for the advanced readers.
[toc] | [prev] | [next] | [standalone]
| From | Corey Richardson <kb1pkl@aim.com> |
|---|---|
| Date | 2011-07-05 12:04 -0400 |
| Message-ID | <mailman.638.1309882223.1164.python-list@python.org> |
| In reply to | #8820 |
[Multipart message — attachments visible in raw view] — view raw
Excerpts from rantingrick's message of Tue Jul 05 07:42:39 -0400 2011:
>
> I was thinking more about this comment and it occurred to me that
> Python does have user controlled data structures. Just because there
> is no "top level syntax" like ruby does not mean these do not exists.
> You only have to look below the surface. Take the sort methods of
> lists for example...
>
> >>> lst = [
> (100, 0),
> (25, 2),
> (10,1),
> ]
> >>> lst
> [(100, 0), (25, 2), (10, 1)]
> >>> lst.sort()
> >>> lst
> [(10, 1), (25, 2), (100, 0)]
> >>> lst.sort(lambda x,y: cmp(x[1], y[1]))
> >>> lst
> [(100, 0), (10, 1), (25, 2)]
>
> ...that looks like a "user defined control" structure to me. So how
> can an anti-feature become part of the language proper? (devils
> advocate here) :)
>
How is giving the sort method a function by which to determine the relative
value of objects a control structure? Do you know what a control structure is?
It's something that you use to modify control flow:
if foo <= bar:
foo += 1
else:
bar += 1
That's a control structurem the "if-else". I don't know what Ruby calls a
control structure, but that's what it is. for and while are in there too.
When you run lst.sort(lambda x, y: cmp(x[1], y[1])), what happens?
We'll call that argument srt, here's a sample (naive) implementation:
def sort(key):
lst = self.internal_list
for n in range(len(self.internal_list) - 1):
for i in range(len(self.internal_list) - 1):
if srt(lst[i], lst[i+1]) < 0:
lst[i], lst[i+1] = lst[i+1], lst[i]
Untested, probably doesn't work either. See what's in there? An if. Nothing
"user-defined" at all. Sure, WHAT the if does is user-controlled with the
key, but that doesn't make that particular if a new control structure, and
it certainly doesn't make the key a control structure. You can pass a key
to a sort even in C and that certainly doesn't have user defined control
structures.
--
Corey Richardson
"Those who deny freedom to others, deserve it not for themselves"
-- Abraham Lincoln
[toc] | [prev] | [next] | [standalone]
| From | rantingrick <rantingrick@gmail.com> |
|---|---|
| Date | 2011-07-05 15:35 -0700 |
| Message-ID | <ab592993-1fd8-4431-a5ff-4d3d76e60787@a7g2000vby.googlegroups.com> |
| In reply to | #8843 |
On Jul 5, 11:04 am, Corey Richardson <kb1...@aim.com> wrote: > How is giving the sort method a function by which to determine the relative > value of objects a control structure? Do you know what a control structure is? > It's something that you use to modify control flow: > > if foo <= bar: > foo += 1 > else: > bar += 1 Interesting, corey. Very interesting. However the fun is yet to come so stay tuned... > That's a control structurem the "if-else". I don't know what Ruby calls a > control structure, but that's what it is. for and while are in there too. > When you run lst.sort(lambda x, y: cmp(x[1], y[1])), what happens? So are you suggesting that a control structure must have at minimum one of "for", "while", or "if"? Okay, i listening. Go on... > We'll call that argument srt, here's a sample (naive) implementation: > > def sort(key): > lst = self.internal_list > for n in range(len(self.internal_list) - 1): > for i in range(len(self.internal_list) - 1): > if srt(lst[i], lst[i+1]) < 0: > lst[i], lst[i+1] = lst[i+1], lst[i] > > See what's in there? An if. Yes there IS and "if" in there and IF you look closely enough you may see two "for"'s also. So by your own definition this (naive) code qualifies as a control structure. Interesting Corey, very interesting. But wait just a second Corey. My statement has nothing to do with sort. sort is just the vehicle. My statement is that the cmp argument to sort IS a user defined control structure (the code block to be exact). It doesn't matter that the code is contained in a function object. That's like saying a cake is not a cake because it was packaged in a shoe box instead of a cake box. > Sure, WHAT the if does is user-controlled with the > key, Well as long as you can admit that fact. > but that doesn't make that particular if a new control structure, Oh i see. Change the rules as we go eh? > and > it certainly doesn't make the key a control structure. You can pass a key > to a sort even in C and that certainly doesn't have user defined control > structures. What the hell does C have to do with Python Corey? One thing is for sure, i always get a giggle from your self defeating posts. You're the best enemy a person could have. Thank you. *bows*
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2011-07-06 08:49 +1000 |
| Message-ID | <mailman.663.1309906180.1164.python-list@python.org> |
| In reply to | #8865 |
On Wed, Jul 6, 2011 at 8:35 AM, rantingrick <rantingrick@gmail.com> wrote: > You're the > best enemy a person could have. Thank you. *bows* Compliments are made to be returned, and this one is particularly well suited. *bow* Chris Angelico
[toc] | [prev] | [next] | [standalone]
| From | Tim Chase <python.list@tim.thechases.com> |
|---|---|
| Date | 2011-07-05 18:21 -0500 |
| Message-ID | <mailman.666.1309908080.1164.python-list@python.org> |
| In reply to | #8865 |
On 07/05/2011 05:35 PM, rantingrick wrote: > One thing is for sure, i always get a giggle from your self > defeating posts. You're the best enemy a person could have. > Thank you. *bows* Every time I see a rantingrick post, it's like watching the Black Knight scene from the Holy Grail yet again. You know what's going to happen; you know he has a purposeless fight; you know he's going to laughably lose; and you know he's going to *think* that he is invincible & has won. ARTHUR: What are you going to do, bleed on me? BLACK KNIGHT: I'm invincible! ARTHUR: You're a looney. Sigh...ready for an intermission... -tkc
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-07-06 21:44 +1000 |
| Message-ID | <4e144a96$0$29982$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #8865 |
rantingrick wrote: > On Jul 5, 11:04 am, Corey Richardson <kb1...@aim.com> wrote: > >> How is giving the sort method a function by which to determine the >> relative value of objects a control structure? Do you know what a control >> structure is? It's something that you use to modify control flow: >> >> if foo <= bar: >> foo += 1 >> else: >> bar += 1 > > Interesting, corey. Very interesting. However the fun is yet to come > so stay tuned... > >> That's a control structurem the "if-else". I don't know what Ruby calls a >> control structure, but that's what it is. for and while are in there too. >> When you run lst.sort(lambda x, y: cmp(x[1], y[1])), what happens? > > So are you suggesting that a control structure must have at minimum > one of "for", "while", or "if"? A control structure is a structure which controls the program flow. Control structures include: * jumps (goto, gosub, comefrom, exceptions, break, continue) * loops (for, while, repeat...until) * conditional branches (if, case/switch) There may be others, although I can't think of any of hand. Jumping, looping and branching pretty much covers all the bases, I think. It excludes expressions such as ternary-if, because that doesn't control program flow, it's just an expression. A function which includes a control structure inside it is not itself a control structure, in the same way that the existence of bones inside you does not make you a bone. [...] > Yes there IS and "if" in there and IF you look closely enough you may > see two "for"'s also. So by your own definition this (naive) code > qualifies as a control structure. I see what you did there. First you put words into Cory's mouth that he did not say, they you try to criticise him based on those words -- YOUR words. No Rick, that's your definition, not Cory's. Please do not treat us as stupid. > But wait just a second Corey. My statement has nothing to do with > sort. sort is just the vehicle. My statement is that the cmp argument > to sort IS a user defined control structure (the code block to be > exact). The cmp argument to sort is not a control structure because it is not a structure and it does not control the program flow. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | rantingrick <rantingrick@gmail.com> |
|---|---|
| Date | 2011-07-06 06:41 -0700 |
| Message-ID | <cdde7932-5bc3-40d2-ba28-d532065620bf@eb1g2000vbb.googlegroups.com> |
| In reply to | #8928 |
On Jul 6, 6:44 am, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > A control structure is a structure which controls the program flow. Control > structures include: > > * jumps (goto, gosub, comefrom, exceptions, break, continue) > > * loops (for, while, repeat...until) > > * conditional branches (if, case/switch) ------------------------------------------- THIS CODE RESULTS IN A CONTROL STRUCTURE! --> lst.sort(lambda x,y: cmp(x[1], y[1])) ------------------------------------------- I am using a user defined spec as an argument to the cmp function. That spec then modifies the body of the compare function and creates a user defined control structure. You can argue all day that it is not a user defined control structure but no one is going to believe you. > A function which includes a control structure inside it is not itself a > control structure, Of course the FUNCTION is not a control structure (not directly). No wonder you are confused. It's the FUNCTION BODY that is the control structure. The function body that has been modified by my arguments to the cmp function. But in a way, you can say the function OWNS the code block so it is itself a control structure. Still confused? Read on... > in the same way that the existence of bones inside you > does not make you a bone. Bad analogy. See last comment. > I see what you did there. First you put words into Cory's mouth that he did > not say, they you try to criticise him based on those words -- YOUR words. I quoted Corey exactly. And why do you feel the need to answer for him? > The cmp argument to sort is not a control structure because it is not a > structure and it does not control the program flow. Again you lack simple reading and comprehension skills. It's not the argument that is the control structure itself. The argument is just the SPEC for creating a control structure. The control structure is the modified CODE BLOCK owned by the "CMP" function. The modified code block owned by the cmp function-- defined by the user through an argument spec-- controls the return value to the list sort method. USER DEFINED CONTROL STRUCTURE. Plain and simple. I don't think i can use any simpler terms to describe it. Give it up man and admit i am correct and you are wrong.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2011-07-06 23:52 +1000 |
| Message-ID | <mailman.699.1309960362.1164.python-list@python.org> |
| In reply to | #8934 |
On Wed, Jul 6, 2011 at 11:41 PM, rantingrick <rantingrick@gmail.com> wrote: > Give it up man and admit i am correct and you are wrong. > Sorry. A Lawful Good character cannot tell a lie. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Neil Cerutti <neilc@norwich.edu> |
|---|---|
| Date | 2011-07-06 15:13 +0000 |
| Message-ID | <97jcchF8akU2@mid.individual.net> |
| In reply to | #8936 |
On 2011-07-06, Chris Angelico <rosuav@gmail.com> wrote: > On Wed, Jul 6, 2011 at 11:41 PM, rantingrick > <rantingrick@gmail.com> wrote: >> Give it up man and admit i am correct and you are wrong. > > Sorry. A Lawful Good character cannot tell a lie. Lawful Good characters have a hard time coexisting with the Chaotic Neutrals. -- Neil Cerutti
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-07-07 00:55 +1000 |
| Message-ID | <4e14776c$0$29998$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #8934 |
rantingrick wrote: > On Jul 6, 6:44 am, Steven D'Aprano <steve > +comp.lang.pyt...@pearwood.info> wrote: > >> A control structure is a structure which controls the program flow. >> Control structures include: >> >> * jumps (goto, gosub, comefrom, exceptions, break, continue) >> >> * loops (for, while, repeat...until) >> >> * conditional branches (if, case/switch) > > ------------------------------------------- > THIS CODE RESULTS IN A CONTROL STRUCTURE! > > --> lst.sort(lambda x,y: cmp(x[1], y[1])) No it doesn't. How does it change the program flow? You call the sort method, it sorts, and execution continues at the next statement. Regardless of whether you supply a cmp function or not, the program flow is identical: ENTER SORT ROUTINE PERFORM SORTING EXIT SORT ROUTINE There is no control transferred. It is a linear program flow: in, do the job, out again. Since it doesn't modify the program flow, it is not a control structure. "Perform sorting" is a black box. It could have loops, branches, unconditional exists. It could have COMEFROM statements up the wazoo, if it were implemented in a language with COMEFROM (like Intercal). None of that matters two bits: the caller cannot use sort to modify the execution sequence around it, therefore it's not a control structure. No matter how much the sort routine jumps around internally, you can't use that change program flow around it. print surely is implemented with a loop: it has to loop over a string and write it to stdout. Would you say that therefore print is a control structure: ENTER PRINT STATEMENT PERFORM PRINTING EXIT PRINT STATEMENT One entry, one exit. -- Steven
[toc] | [prev] | [next] | [standalone]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | comp.lang.python
csiph-web