Page 1 of 1

Breaking out of dolist...

Posted: Thu Dec 01, 2005 12:10 am
by Sunburned Surveyor
Is it possible to break out of a dolist loop before all of the elements in the subject list have been iterated through?

For example, I want to use dolist to manipulate each element in a list until I reach an element with a certain value. Is this possible?

What syntax would I use to break out of a dolist or other loop in NewLISP?

I checked the NewLISP manual, but I couldn't find a "break" statement that is common to other languages.

The Sunburned Surveyor

Posted: Thu Dec 01, 2005 1:53 am
by Sammo
See the (dotimes ...) example in the Throw section of the help file.
-- Sam