Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

While-loop , can't BREAK

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a List filter. for example, in the coding below, I am trying to filter the people whose age is 30.

But it can NOT jump out the while-loop, when it should break. I don't know why ? THe coding is complete, you could test it.

Thanks for your help.

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're looping in two different ways: the "while true" loop, and a recursive call to the same routine. The recursive call is unnecessary; after modifying the list, you can just let the loop go again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic