On 7-Sep-07, at 5:12 PM, William Tanksley, Jr wrote: > You're probably right; the complexity of that shuffle is just too high > (I was pretty much slapping the keyboard to generate that one). I > suspect any shuffle with more than 3 or (max) 4 is too complex. > > I really hate using locals. But they would be better than that shuffle > -- unless the shuffle were simply adapting to a foreign API (win32, > for example).
Lately we've been using the following idiom to deal with painful Win32 APIs. All the parameters are constructed then packed into a tuple object over the course of several words -- this can take a lot of code when you have 11 parameters, some of which are structs, etc. Then, the tuple is unpacked and the API call is made. Finally, the parameters are cleaned up, and values are extracted from out- parameters; many Win32 APIs require inputs which must be manually allocated, and since we can iterate over a tuple's slots reflectively, much of the deallocation boilerplate can be eliminated. Slava ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
