Search the web
Sign In
New User? Sign Up
varaq-dev · for developers of and for the Klingon programming language var'aq
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Vangqa' nested loop fix   Message List  
Reply | Forward Message #396 of 616 |
As I was annoyed by it, I fixxed it; though it's probably a dirty fix
:p

Version used is varaq-010201, the current stable version.

Changes in my source:
- naqmoH -> naQmoH
- the vangqa' if ($escv = 1) { -> if ($escv == 1) {

And of course the vangqa fix, accomplished this way:

Added a counter for which loop is executed; $cval and $block are now
arrays: $cval[] and $blocka[]. The counter is $vangqacount ("vangqa-
count").

execblock now takes $block as an argument; syntax: &execblock($block)

Note that there probably are some more $block interference problems,
I
will fix them if I find them (or mail them to me :))



Diff: (which contains some weird thingt, but I'm not into diffs
enough
to fix them, probably just some enters added?)

13,14c13,14
< # and general plumbing) under terms of the Mozilla Public License
(see
< # http://www.mozilla.org for details).
---
> # and general plumbing) under terms of the Mozilla Public License
(see
> # http://www.mozilla.org for details).
127c127
< {
---
> {
151,152c151,154
< for($i = 0; $i <= $#{$block}; $i++) {
< execute($block->[$i]); # recursively exec defined
procedure
---
>
> my $blok = shift;
> for($i = 0; $i <= $#{$blok}; $i++) {
> execute($blok->[$i]); # recursively exec defined
procedure
183c185
<
---
>
221c223
<
---
>
235c237
< push @{$stack}, $temp;
---
> push @{$stack}, $temp;
253c255
<
---
>
257c259
< $pval = 'mk';
---
> $pval = 'mk';
341c343
<
---
>
373c375
<
---
>
418c420
< }
---
> }
469c471
<
---
>
483c485
< } elsif ($cmd eq 'naqmoH') {
---
> } elsif ($cmd eq 'naQmoH') {
503c505
< execblock();
---
> &execblock($block);
516c518
< execblock();
---
> &execblock($block);
519,520d520
< $block = pop @{$stack};
< $cval = pop @{$stack};
522c522,528
< if (ref($block) ne 'ARRAY') # better safe than sorry
---
> $vangqacount++;
> ##print "\nvcount: ".$vangqacount;
> $blocka[$vangqacount] = pop @{$stack};
> $cval[$vangqacount] = pop @{$stack};
>
>
> if (ref($blocka[$vangqacount]) ne 'ARRAY') # better
safe than sorry
527,530c533,538
< while ($cval > 0) {
< execblock();
< if ($escv = 1) {
< $cval = 1;
---
> while ($cval[$vangqacount] > 0) {
> print "\ncval: ".$cval[$vangqacount];
> &execblock($blocka[$vangqacount]);
>
> if ($escv == 1) {
> $cval[$vangqacount] = 1;
533c541,542
< $cval--;
---
> $cval[$vangqacount]--;
>
534a544
> $vangqacount--;
545c555
< execblock();
---
> &execblock($block);
558,560c568,570
< # (j proctor) Perl makes escaping easy: if it encounters this in
the
middle of
< # executing a proc, it'll jump immediately to the end of it. If
< # there's nothing next, well, it's done.
---
> # (j proctor) Perl makes escaping easy: if it encounters this in
the
middle of
> # executing a proc, it'll jump immediately to the end of it. If
> # there's nothing next, well, it's done.
567c577
<
---
>
571c581
<
---
>







Wed May 11, 2005 2:56 pm

mvdee
Offline Offline
Send Email Send Email

Forward
Message #396 of 616 |
Expand Messages Author Sort by Date

As I was annoyed by it, I fixxed it; though it's probably a dirty fix ... Version used is varaq-010201, the current stable version. Changes in my source: -...
mvdee
Offline Send Email
May 11, 2005
2:58 pm

... should be removed from the diff Or you'll get some weird results :) (and junk testing code in your source, you don't want that :p)...
mvdee
Offline Send Email
May 11, 2005
3:05 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help