in reply to Re^15: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
Because all that should be needed (on windows) isYou do realize your idea will break $^E?#define PERL_GET_CONTEXT TlsGetValue(PL_thr_key) #define PERL_SET_CONTEXT(t) TlsSetValue(PL_thr_key, (t))Quite why those calls are bracketed to preserve information from a previous error is strange.
What previous error have we ignored -- by continuing to this piece of code -- that we want to retain the extended error information for?
And what are we going to do with that retained information? And when?
IMHO, LastError is a terrible design. Native API's NTSTATUS error code system is much better thought out (http://msdn.microsoft.com/en-us/library/cc231200%28v=prot.10%29) with positive signed numbers being informational non-errors, 0 being success with no information, and negative being errors.$obj = Win32::Foo->new("create me"); #new returned a blessed object $obj = Win32::Foo->new("dont create me"); #new returned undef and LastError has failure code, DESTROY of "create + me" fires, changes LastError if(! defined $obj){ #$^E happens to be ERROR_SUCCESS (it is actually undefined/random +), programmer pounds head on keyboard screaming WHY ME!!!! die "creating obj failed ".($^E+0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^17: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
by BrowserUk (Patriarch) on Aug 30, 2012 at 08:14 UTC | |
by bulk88 (Priest) on Aug 30, 2012 at 17:09 UTC | |
by BrowserUk (Patriarch) on Aug 30, 2012 at 17:22 UTC |