
Hi Thilo, Quoting [Thilo Kielmann] (Sep 11 2005):
Hi Andre and all,
regarding copy semanctics of SAGA calls: (shallow vs. deep vs. references)
As the SAGA implementation should obviously show the
Ah, typo: implemention_S_
same behaviour (either one for now), the spec needs to define that obviously.
Not quite. These issues are certainly beyond SAGA functionality. Rather, this should be addressed by the respective language bindings. For each language, the SAGA spec might "prescribe" to stick with the conventions of each language. IMHO, this would contribute to the "simple" attribute of SAGA: it would be simple as would do in any language what programmers are used to.
In your case, the C++ binding could prescribe shallow copies (and maybe explicit "clone"), as this is what C++ does usually...
I think I disagree here. For one thing, as far as I understood there is no convention which holds for C++ in general, or for C in general etc. Second, that would lead to semantical differences in the different languages. I guess we don't want that. E.g., the following code would then possibly behave differently in C++/Java: +-----------------------------------------------------------------+ saga::job_description jd_1 = my_job.get_job_description (); saga::job_description jd_2 = jd_1; jd_2.set_attribute ("SAGA_Host", "localhost"); +-----------------------------------------------------------------+ The state of jd_2 would differ in C++ and Java then, and I'd think we would like to avoid that, don't we? If we allow that, you basically have to re-learn (small parts of) the semantics for SAGA for each language... Cheers, Andre.
My two cents,
Thilo
-- +-----------------------------------------------------------------+ | Andre Merzky | phon: +31 - 20 - 598 - 7759 | | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 | | Dept. of Computer Science | mail: merzky@cs.vu.nl | | De Boelelaan 1083a | www: http://www.merzky.net | | 1081 HV Amsterdam, Netherlands | | +-----------------------------------------------------------------+