Re: qsort and arbitrary types

From: Richard Maine (nospam_at_see.signature)
Date: 06/09/04


Date: 09 Jun 2004 14:01:29 -0700

Janne Blomqvist <jblomqvi@roskaposti.invalid> writes:

> ...Fortran uses pass by reference...

Knee-jerk reaction, but, to repeat what I and others have said
many times before....

This has never been specified in the standard. It is a (very)
common implementation method, but has never been universal;
there have long been exceptions.

With newer features and compilers, the exceptions are becoming less
and less exceptional. Some new features are pretty much impossible to
implement with pass by reference. Even for old features, things like
copy-in/copy-out are sometimes used by modern optimizers.

I recommend against programming based on the assumption that arguments
will be passed by reference. It certainly doesn't seem like an
assumption that will leave you well prepared for the future... or
even some parts of the present.

-- 
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain


Relevant Pages

  • Re: qsort and arbitrary types
    ... >> With newer features and compilers, the exceptions are becoming less ... Some new features are pretty much impossible to ... >> implement with pass by reference. ...
    (comp.lang.fortran)
  • Re: qsort and arbitrary types
    ... the exceptions are becoming less ... Some new features are pretty much impossible to ... >>implement with pass by reference. ... The Fortran rules were designed to allow the compiler to ...
    (comp.lang.fortran)
  • Re: some c# questions!! please send me the answer
    ... TryParse first to see if the string is a valid DateTime before doing ... In .NET 1.1 all you can do is Prase and catch any exceptions ... Boxing is creating a "reference" shell around a value object so that it ... each "int" and then adds those object wrappers to the ...
    (microsoft.public.dotnet.csharp.general)
  • Re: .Net COM+
    ... write your own IUnknown to expose a programmatic interface to ... management leaves a lot to be desired (Reference counts isn't perfect, ... transaction features can be used .. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: MS Data Access Block
    ... features, I meant in my program that uses the block, not that I made changes ... in project 'Forms1' cannot be copied to the run directory because it would ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)