[Mono-list] Determining the platform at compile and run time
A Rafael D Teixeira
rafaelteixeirabr@hotmail.com
Sun, 02 Nov 2003 01:12:40 -0200
>From: Fergus Henderson <fjh@cs.mu.OZ.AU>
>
>On 31-Oct-2003, A Rafael D Teixeira <rafaelteixeirabr@hotmail.com> wrote:
> > I could use your try/catch solution, but I prefer to use "decisions
> > construed over known information" than "try/catch" for performance
>reasons.
>
>If that's the only reason, then another alternative that does not use
>try/catch is to use reflection to see which interfaces are present.
Well in truth I dislike even more the mono runtime warning on loading
something that binds to non-existent lib, that was my main motivation, have
a solution that runs unmodified and silently in .NET (without any Mono libs)
and in Mono.
>But basing the decision on minor performance issues like this seems like
>a bad reason anyway, since this try/catch or reflection code only needs
>to be executed at most once each time the program is run. After that,
>the result can be cached in a variable.
True, but rolling back a bit I don't think that reflection can be used to
ask for internalcalls and pinvokes (see if I load the library that pinvokes
to use reflection on it, I would have warnings popping).
Anyway, thanks Fergus for your thoughts,
Best regards,
Rafael Teixeira
Brazilian Polymath
Mono Hacker since 16 Jul 2001
MonoBrasil Founder
English Blog: http://monoblog.blogspot.com/
Brazilian Portuguese Blog: http://monoblog.weblogger.terra.com.br/
>
>--
>Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the
>pursuit
>The University of Melbourne | of excellence is a lethal habit"
>WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
>_______________________________________________
>Mono-list maillist - Mono-list@lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
_________________________________________________________________
MSN Messenger: instale grátis e converse com seus amigos.
http://messenger.msn.com.br