Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: improve ugly flow control

by Aristotle (Chancellor)
on Sep 19, 2004 at 11:07 UTC ( #392163=note: print w/replies, xml ) Need Help??


in reply to Re: improve ugly flow control
in thread improve ugly flow control

In the same vein, but along a different angle:

foreach my $i ( 0 .. $#options, 'fail' ) { if( $i eq 'fail' ) { log_failure(); last; } if( exists $hash{ $options[ $i ] } ) { do_something( $options[ $i ] ); last; } }

Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://392163]
help
Chatterbox?
[Corion]: erix: There is somebody who has hacked up some Ruby scripts to do just that, but the Ruby scripts have some hardcoded #defines (well, reimplement those), so the extraction doesn't compile for Windows...
[Corion]: libpg_query
[Corion]: ... and I think "porting" it basically means (re)implementing a C preprocessor and feeding that one with the appropriate #defines for the platforms, and/or providing stub implementations for OS-specific functions that the query parser really wants to call
[erix]: ah, interesting. Well, sounds like a good start..
[Corion]: In the long run, obviously, the parser wouldn't need/call OS-specific stuff anyway, but we're a long way from that :D
[Corion]: erix: Yeah - I think basically the solution should be a "fake_os.h", which implements just enough stub routines for any OS to make the compilation of the parser pass. But for that, the complete (relevant) source code needs to be extracted, and the ...
[Corion]: ... Ruby script only extracts parts of the source code as Windows-specific files aren't considered relevant
[erix]: you got your work cut out for the hoidays :)
[erix]: +l

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2018-07-23 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (464 votes). Check out past polls.

    Notices?