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 | 4 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 4 of 4 — ← Prev page 1 2 3 [4]
| From | rantingrick <rantingrick@gmail.com> |
|---|---|
| Date | 2011-07-06 08:33 -0700 |
| Message-ID | <0fe80b69-c53f-4f04-84ea-e58fae5bdb79@k27g2000yqn.googlegroups.com> |
| In reply to | #8941 |
On Jul 6, 9:55 am, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > rantingrick wrote: > > ------------------------------------------- > > 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: Not identical. The sort called WITHOUT a cmp argument will sort in a predefined manner. The sort called WITH a cmp argument can modify the existing code block in a way that suits a users desired result. A USER DEFINED CONTROL STRUCTURE. Just because this realization breaks the mold of everything you hold dear about user defined control structures does not mean it is incorrect. For some reason you are religious about this subject. Could it be that you are wrong? > ENTER SORT ROUTINE > PERFORM SORTING > EXIT SORT ROUTINE True for the non-modified case. False for the modified one... ENTER SORT ROUTINE PERFORM SORTING BASED ON USER DEFINED CONTROL 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. So you are telling me that calling cmp(itemsA[idx], itemsB[idx]) is exactly the same as cmp(itemsA[idx][-1], itemsB[idx[-1])? Please show proof of this in code. You have just witnessed the power of user defined control structures and it has rocked your little world. You believed UDCS to be evil, all the while oblivious to your own everyday usage of them. Now that's ironic. Cruel or poetic, you be the judge. > "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. The "jumping"(sic) around is controlled by a user defined spec. The user is in control. The user made the definition. The cmp function just implemented 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 Nope. Print only takes an argument and spits out the result to stdout.write. Print is an abstraction API for system.stdout.write, and nothing more. > One entry, one exit. As evident from all the BS you spew on a daily basis, apparently YOU have one entry and one exit!
[toc] | [prev] | [next] | [standalone]
| From | Teemu Likonen <tlikonen@iki.fi> |
|---|---|
| Date | 2011-07-06 19:55 +0300 |
| Message-ID | <87wrfv9wme.fsf@mithlond.arda> |
| In reply to | #8934 |
* 2011-07-06T06:41:52-07:00 * <rantingrick@gmail.com> wrote:
> 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.
I won't argue all day, I'll just show you an example of a user defined
control structure. This is like the standard (DOTIMES (VAR COUNT) BODY)
macro expect that it executes BODY forms first forwards and then
backwards. The iterator variable VAR goes first up from 0 and then down
to 0.
(defmacro ping-pong-iterator ((var count &optional result)
&body body)
`(progn (loop for ,var from 0 below ,count
do (progn ,@body))
(loop for ,var from (1- ,count) downto 0
do (progn ,@(reverse body))
finally (return ,result))))
CL-USER> (ping-pong-iterator (i 3 "ready")
(format t "form 1: ~A~%" i)
(format t "form 2: ~A~%" i)
(format t "form 3: ~A~%" i)
(format t "~%"))
form 1: 0
form 2: 0
form 3: 0
form 1: 1
form 2: 1
form 3: 1
form 1: 2
form 2: 2
form 3: 2
form 3: 2
form 2: 2
form 1: 2
form 3: 1
form 2: 1
form 1: 1
form 3: 0
form 2: 0
form 1: 0
=> "ready"
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2011-07-06 19:05 +1200 |
| Message-ID | <97ifp6FjfuU1@mid.individual.net> |
| In reply to | #8820 |
rantingrick wrote: > 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. Syntax is what it's really about, though. There's no clear dividing line, but when Guido says he's opposed to "user defined syntax" he's talking about things like Lisp macros, which let you effectively extend the grammar with new keywords and syntactic structures. Compared to that, Python's grammar is very much fixed. Anything you want to do has to be done within the existing framework of function calls, attribute references etc. If Python truly had user-defined syntax, it wouldn't have been necessary to modify the compiler to implement features such as list comprehensions and with-statements -- those features could have been implemented, with the *same syntax* or something close to it, in the base language. -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-07-03 13:21 +1000 |
| Message-ID | <4e0fe03f$0$29972$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #8691 |
rantingrick wrote: > Hello fellow programmers, scripters, hackers, and debutantes. Your ideas are intriguing to me and I wish to subscribe to your newsletter. -- Steven
[toc] | [prev] | [standalone]
Page 4 of 4 — ← Prev page 1 2 3 [4]
Back to top | Article view | comp.lang.python
csiph-web