Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8957

Re: The end to all language wars and the great unity API to come!

From Teemu Likonen <tlikonen@iki.fi>
Newsgroups comp.lang.python
Subject Re: The end to all language wars and the great unity API to come!
Date 2011-07-06 19:55 +0300
Organization A noiseless patient Spider
Message-ID <87wrfv9wme.fsf@mithlond.arda> (permalink)
References (9 earlier) <22a13bda-899d-4765-a03c-f8a36efaf905@34g2000yqr.googlegroups.com> <mailman.638.1309882223.1164.python-list@python.org> <ab592993-1fd8-4431-a5ff-4d3d76e60787@a7g2000vby.googlegroups.com> <4e144a96$0$29982$c3e8da3$5496439d@news.astraweb.com> <cdde7932-5bc3-40d2-ba28-d532065620bf@eb1g2000vbb.googlegroups.com>

Show all headers | View raw


* 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"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web