Author Topic: Evaluate a list and return the nil  (Read 13999 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Evaluate a list and return the nil
« Reply #15 on: October 23, 2003, 12:53:18 PM »
looks correct to me, but se7en while have to make the final say-so since he started this mess........:D
TheSwamp.org  (serving the CAD community since 2003)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Evaluate a list and return the nil
« Reply #16 on: October 23, 2003, 12:54:34 PM »
if you are after the index, this may suit :
Code: [Select]

(defun test (theList / tmp)
  (if (setq tmp (member nil theList))
    (1+ (- (length theList) (length tmp)))
    nil
  )
)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Evaluate a list and return the nil
« Reply #17 on: October 23, 2003, 01:03:01 PM »
Oh i dont care. I was origionaly looking for the opposite of "cond" like it was the fountian of youth or something but anyof those will do.  Thanx alot guys.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Evaluate a list and return the nil
« Reply #18 on: October 23, 2003, 01:07:11 PM »
If i had to pick one i would have to say marks because its cleaner.  But their all cool.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Evaluate a list and return the nil
« Reply #19 on: October 23, 2003, 01:15:16 PM »
Quote

< snip > and I want to run thru the list to see what member dose not have a value.

I can use a "(mapcar 'cond "mylist")" to evaluate each member of my list but that dosent tell me which one in the list is nil.


ahh ok ..
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.