Fwd (kielmann at cs.vu.nl): Fwd (craig at rush.aero.org): Re: [saga-rg] deep copy / shallow copy

Andre Merzky andre at merzky.net
Mon Sep 19 07:06:36 CDT 2005


Quoting [Thilo Kielmann] (Sep 12 2005):
> > Subject: Re: [saga-rg] deep copy / shallow copy
> > 
> > But, one could argue that when programming in a given language,
> > the copy/assignment operator will be used for both SAGA and non-SAGA 
> > objects.
> > That is to say, the programmer should be/will be aware of the
> > copy/assignment semantics throughout the program.
> 
> Nicely put, Craig! That's what I tried to say...

I agree.  


> > I agree that differing copy/assignment semantics could cause problems
> > for a programmer, but I don't see how a SAGA binding could dictate 
> > copy/assignment
> > semantics that are different from a language's "native" semantics.

The question is if there are language native semantics for
these - from what I learned, there are no clear conventions.
So, yes, we could leave that to the language bindings.  But
it might make sense to add a statement to the general spec
such as:

  "unless defined otherwise by the language bindings, copy
  and assignement operators will perform a shallow copy"

or so. 


> > Besides being difficult or impossible to implement, this means that
> > different objects within a single program could have different 
> > copy/assignment
> > behavior, depending on whether they were SAGA or non-SAGA objects.
> > This, too, could cause problems.
> > 
> > I think this should be left as a language binding issue.  Nonetheless,
> > the SAGA API doc could have a prominent "Advice to Practitioners"
> > section that identifies and discusses these binding pitfalls.
> 
> Sounds right to me.

Right, that probably is the same at the end.

Thanks, Andre.


> Thilo

-- 
+-----------------------------------------------------------------+
| Andre Merzky                      | phon: +31 - 20 - 598 - 7759 |
| Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
| Dept. of Computer Science         | mail: merzky at cs.vu.nl       |
| De Boelelaan 1083a                | www:  http://www.merzky.net |
| 1081 HV Amsterdam, Netherlands    |                             |
+-----------------------------------------------------------------+





More information about the saga-rg mailing list