From: Robert Klemme Date: 2004-01-13T21:36:37+09:00 Subject: Re: [HELP] : how can I write a goto in ruby "smayemba" schrieb im Newsbeitrag news:4003e1cb$0$17143$626a54ce@news.free.fr... > I am working in an university project. I have to translate an embedded lisp > interpretor wrote in Java in another language. I chose Ruby. In the java > code, > i don't success to translate that kind of code in Ruby : > > public static void eval() > { > begin_eval: //label (1) > while( 1 ) > { > //some code come here > > evalcar: //label (2) > while( 1 ) > { > switch( x ) > { > case > ... > default : > if foo > break begin_eval //goto (1) > continue evalcar //goto (2) > } > } > } > } > > In ruby i don't know how to translate a <> and < label>>. It's like some goto ?? You can use "next" and "break": def eval_lisp loop do # some code come here loop do case # ... else break if foo next end end end end Regards robert