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

T

Teemu Likonen

* 2011-07-06T06:41:52-07:00 * said:
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"
 
S

sal migondis

sal migondis wrote:
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.
 
I

Ian Kelly

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?
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top