@@ -152,14 +152,21 @@ EOF
152152 );
153153}
154154
155+ sub g_c {
156+ my ($func, $arg) = @_;
157+ $got_complex{$func} = PDL::Core::Dev::got_complex_version($func, $arg);
158+ print "got_complex_version($func, $arg): $got_complex{$func}\n";
159+ $got_complex{$func};
160+ }
161+
155162#simple binary functions
156163sub bifunc {
157164 my ($name,$func,$mutator,$doc,%extra) = @_;
158165 my $funcov = ref $func eq 'ARRAY' ? $func->[1] : $func;
159166 my $isop = $funcov =~ s/^op//;
160167 my $funcovp = protect_chars $funcov;
161168 $func = $func->[0] if ref $func eq 'ARRAY';
162- my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version ($func, 2);
169+ my $got_complex = g_c ($func, 2);
163170 $extra{GenericTypes} = [ grep exists $is_real{$_}, @{$extra{GenericTypes}} ]
164171 if !$got_complex and $extra{GenericTypes};
165172 $extra{HdrCode} .= << 'EOH';
@@ -216,7 +223,7 @@ sub ufunc {
216223 my $funcov = ref $func eq 'ARRAY' ? $func->[1] : $func;
217224 my $funcovp = protect_chars $funcov;
218225 $func = $func->[0] if ref $func eq 'ARRAY';
219- my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version ($func, 1);
226+ my $got_complex = g_c ($func, 1);
220227 $extra{GenericTypes} = [ grep exists $is_real{$_}, @{$extra{GenericTypes}} ]
221228 if !$got_complex and $extra{GenericTypes};
222229
0 commit comments