[gameprogrammer] Re: More scripting engines

  • From: Bernhard Bliem <bernhard.bliem@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sat, 24 Apr 2004 17:18:38 +0200

That's an interesting idea. However, wouldn't a goto be actually sufficient?

If not, here's another syntax that came into my mind:

[outmost] while something { ... }

You could put labels into square brackets (or something similar)...

Just my 2 cents :)

David Olofson wrote:
> Just had an idea. (Probably not a new one, though I haven't seen it 
> before myself.) I was going to have these "multilevel" break 
> statements, but I don't like the "break <n>" form, where you have to 
> explicitly specify the number of levels you want to jump. (Wrap a 
> loop in an extra loop forgetting to adjust your breaks, and weird 
> things start happening...)
> 
> So, if figured I'd name the nesting levels instead, something like 
> this:
> 
>       while something
>       outmost
>       {
>               while something_else
>               {
>                       check some, stuff;
>                       if all_done
>                               break outmost;
>                       if nope
>                               break;
>               }
>       }
> 
> where 'outmost' {...} would be a named scope. (A {...} delimited block 
> is a statement, so I can just add NAME '{' block '}' to that grammar 
> rule grammar.)
> 
> Another syntax variant:
> 
>       while something
>       {
>               nestlevel outmost;
>               while something_else
>               {
>                       check some, stuff;
>                       if all_done
>                               break outmost;
>                       if nope
>                               break;
>               }
>       }
> 
> This was my first thought, but I don't quite like it. I'm not totally 
> happy with NAME '{' block '}' either though.
> 
> If anyone has some interesting ideas for the syntax, I'm all ears. :-)
> 
> 
> //David Olofson - Programmer, Composer, Open Source Advocate
> 
> .- Audiality -----------------------------------------------.
> |  Free/Open Source audio engine for games and multimedia.  |
> | MIDI, modular synthesis, real time effects, scripting,... |
> `-----------------------------------> http://audiality.org -'
>    --- http://olofson.net --- http://www.reologica.se ---
> 
> 
> 

Other related posts: