llancet has asked for the wisdom of the Perl Monks concerning the following question:
However, in the perl's C interface, calls like av_store, av_fetch, hv_store, hv_fetch, av_push, av_pop, the scalar itself is really being stored to the container, or fetched from the container, instead of its copy. So, if I'm going to make a general-purpose C++ wrapper for perl, should I imitate the behavior of perl, or just follow the behavior of perlapi?my @array; my $i = "abcd"; $array[0] = $i; # $array[0] won't change $i = "efgh"; my %hash; my $i2 = 1234; $hash{'key'} = $i2; # $hash{'key'} won't change $i2 = 5678;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The behavior of array and hash OPs
by Anonymous Monk on Jun 22, 2011 at 07:07 UTC | |
|
Re: The behavior of array and hash OPs
by 7stud (Deacon) on Jun 22, 2011 at 01:27 UTC | |
by ikegami (Patriarch) on Jun 22, 2011 at 04:05 UTC | |
by 7stud (Deacon) on Jun 22, 2011 at 06:01 UTC | |
by frieduck (Hermit) on Jun 22, 2011 at 16:05 UTC | |
| |
by llancet (Friar) on Jun 23, 2011 at 08:35 UTC | |
|
Re: The behavior of array and hash OPs
by locked_user sundialsvc4 (Abbot) on Jun 22, 2011 at 15:58 UTC | |
by llancet (Friar) on Jun 23, 2011 at 08:39 UTC |