Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > Re: Returning n...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 9 Topic 12402 of 13603
Post > Topic >>

Re: Returning no value

by Ken Tilton <kennytilton@[EMAIL PROTECTED] > May 1, 2008 at 10:43 PM

Steven M. Haflich wrote:
> I think the OP may be looking for something like this:
> 
> cl-user(10): (defun foo()
>           (let ((x (random 10)))
>         (and (< 5 x) x)))
> foo
> cl-user(11): (loop repeat 10
>         as x = (foo)
>         when x collect x)   ; <<<<<
> (6 8 9)

Sweet. But not wnat someone already offered?:

   (loop repeat 10
         when (foo)
         collect it)

As for the use of as, C'ers flame over placing braces in an if statement 
-- has there ever been a Lisp flamewar over for vs. as?

If not, is it possible there is a limit to our collective Usenet idiocy? 
I feel we are on the verge of an im****tant result.

Do you have a rationale for preferring as over for? I can guess at one 
but do not want to compromise the research.

Do you use for with in and as with = or always go with as? If so, then 
likewise with for and not as with on, across, over, below, and under?

kenny

-- 
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/

"I've never read the rulebook. My job is to catch the ball."
   -- Catcher Josh Bard after making a great catch on a foul ball
and then sliding into the dugout, which by the rules allowed the
runners to advance one base costing his pitcher a possible shutout
because there was a runner on third base.

"My sig is longer than most of my articles."
   -- Kenny Tilton
 




 9 Posts in Topic:
Returning no value
dstein64 <DStein64@[EM  2008-04-30 11:27:00 
Re: Returning no value
pmechai@[EMAIL PROTECTED]  2008-04-30 20:37:52 
Re: Returning no value
Zach Beane <xach@[EMAI  2008-04-30 14:38:05 
Re: Returning no value
Geoffrey Summerhayes <  2008-04-30 11:42:50 
Re: Returning no value
tar@[EMAIL PROTECTED] (T  2008-04-30 14:26:49 
Re: Returning no value
"Steven M. Haflich&q  2008-05-02 01:41:36 
Re: Returning no value
Ken Tilton <kennytilto  2008-05-01 22:43:59 
Re: Returning no value
globalrev <skanemupp@[  2008-05-01 01:56:38 
Re: Returning no value
"Alex Mizrahi"   2008-05-01 15:46:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 2:25:32 CDT 2008.