Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Those that work on win32 must bend their minds to the environment. Win32 wasn't designed for programmers like unix was. Win32 is about pain. Win32 is about making Suits happy. Win32 is about keeping the riff-raff from writing their own applications instead of buying them. It's about making sure the lowest common demoninator macro writer doesn't hose the system (this goal hasn't been met with all that much success).

    Recently, I've had some new adventures in OLE programming and already my eyes have nearl

    • Yeah, but different culture is no excuse. When Matthias did the mappings for Mac OS for MacPerl (now a part of Mac::Carbon, and I copied over his strategy into the Mac::Carbon docs []), he made these two design decisions:

      • MacPerl toolbox calls take their input arguments in the same order as the corresponding toolbox functions. Output arguments are never passed by reference, but returned from the calls. If there are several output arguments, a list is returned. If an error occurs, the function returns undef or () and the error code is available in the $^E variable.
                $port = GetPort();
                $desc = AECreateDesc("TEXT", "Hello, World") or die $^E;
      • Complex data structures are mapped into blessed references. Data fields are available through member functions which return the value of a field if called without an argument and change the value if called with an argument.
                $rect = Rect->new(10, 20, 110, 220);

      The Mac OS culture is/was about as different from the Perl culture as the Win32 culture, but it can be made to work, without too much difficulty.
      • BTW, there is also another issue, which is having a Perl API on top of the C API. That is, instead of:
        $desc = AECreateDesc("TEXT", "Hello, World") or die $^E;
        You can also do:
        $desc = AEDesc->new("TEXT", "Hello, World") or die $^E;
        And it gets even more simplified with things like Mac::AppleEvents::Simple, which takes several calls to various Mac::AppleEvents functions and wraps them into single calls.