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

pdl2: Demos fail with Can't locate object method "slice" via package "comment" ... #424

Closed
HaraldJoerg opened this issue Apr 13, 2023 · 1 comment

Comments

@HaraldJoerg
Copy link
Contributor

pdl2 gives the following identification:

Perldl2 Shell v0.008
      PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
      'COPYING' in the PDL distribution. This is free software and you
      are welcome to redistribute it under certain conditions, see
      the same file for details.

Loaded plugins:

  CleanErrors
  Commands
  Completion
  CompletionDriver::INC
  CompletionDriver::Keywords
  CompletionDriver::LexEnv
  CompletionDriver::Methods
  DDS
  FindVariable
  History
  Interrupt
  LexEnv
  MultiLine::PPI
  NiceSlice
  PDLCommands
  Packages
  PrintControl
  ReadLineHistory


Type 'help' for online help

Type Ctrl-D or quit to exit

Loaded PDL v2.082

load_rcfile: got $HOME = /home/haj
load_rcfile: loading PDL/default.perldlrc

The demos don't work in this setup: They die with the following message (with Devel::Confess enabled):

Runtime error: Can't locate object method "slice" via package "comment" (perhaps you forgot to load "comment"?) at (eval 396)[/usr/share/perl5/Devel/REPL.pm:120] line 18.

The "traditional" perldl shell works fine for the demos!

@mohawk2
Copy link
Member

mohawk2 commented Apr 14, 2023

Thanks for the report! This was because the environment where the demo command runs in pdl2 did indeed have NiceSlice enabled, which means you can't do $coderef->(...). However, changing it to &{$coderef}(...) makes it work fine.

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