#20 $world->expandalias() returns undef

closed
nobody
None
5
2009-02-05
2009-02-01
Matthew S
No

I don't understand XS, so I can't tell what's going wrong here, but no matter what I feed into expandalias, it keeps returning an uninitialised value.

I'm on Ubuntu 8.10, using svn r1015 as of now.

Discussion

  • I really can't reproduce this - it works fine here. From the code, the only situation that should return undef (or nothing) is when the argument is missing.

    Does the alias work when typed? And what alias is that?

     
  • Matthew S
    Matthew S
    2009-02-04

    I updated to r1019, and still no go. It's not working in both cases:

    - when there's aliases that should be substituted
    - when there's no aliases that should be substituted

    /$world->send($world->expandalias("em"));\ /$world->send($world->expandalias("foo"));

    Both give:
    Perl Error: Can't call method "send" on an undefined value at (eval 19438) line 1.

    PS: After further investigation, I found something interesting:

    /use Data::Dumper; $world->echonl(Dumper($world->expandalias("foo")));
    Perl Error: panic: memory wrap at (eval 40071) line 1.

    Meanwhile:
    /use Data::Dumper; $test = $world->expandalias("foo"); $world->echonl(Dumper(\$test));
    $VAR1 = \'foo';

    So, it IS working, you just need an intermediate variable, instead of the method you prescribed in the response to the feature request.

     
  • OK, now I see it. Indeed, if used directly as argument the function does not work, but it did if the result was saved in a variable.

    I've changed the way the function works internally, it should be working now.

     
    • status: open --> closed