Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SF#391 Operators called in the form "explicit call with trailing 0" give syntax error #125

Closed
zmughal opened this issue Jun 17, 2015 · 1 comment

Comments

@zmughal
Copy link
Member

zmughal commented Jun 17, 2015

From http://sourceforge.net/p/pdl/bugs/391/

The docs for many functions in PDL::Ops give 3 ways to call the function. Using 'lt' as an example:

   $c = lt $a, $b, 0;     # explicit call with trailing 0
   $c = $a < $b;           # overloaded call
   $a->inplace->lt($b,0);  # modify $a inplace

The first form does not work as advertised.

$a = pdl(1,2,3); $b = pdl(3,2,1);
$c = lt $a, $b, 0;
syntax error at (eval 67) line 4, near "= lt"

Similarly 'plus' gives this example that does not work:

$c = plus $a, $b, 0;
Usage:  PDL::plus(a,b,c,swap) (you may leave temporaries or output variables out of list)

and so on... The ->inplace form seems to work OK.

perldl -V attached.

Marking as priority '7' because it seems pretty important, but my guess is very few people actually try to call the functions that way (as evidenced by the fact that nobody has reported this before).

@mohawk2
Copy link
Member

mohawk2 commented May 21, 2021

This was actually fixed in 2139f08

@mohawk2 mohawk2 closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants