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

PDL module which enables extra sanity checks #175

Closed
zmughal opened this issue Jan 9, 2016 · 4 comments
Closed

PDL module which enables extra sanity checks #175

zmughal opened this issue Jan 9, 2016 · 4 comments

Comments

@zmughal
Copy link
Member

zmughal commented Jan 9, 2016

e.g.,

  • enable the checking on sclr

Something like PDL::Strict. We should check for other such opportunities and add them to the module as time passes.

What do you think?

@mohawk2
Copy link
Member

mohawk2 commented Dec 27, 2021

I can't think of any sanity-checks (apart from the eternal problem of bounds-checking) that we could even implement, never mind turn on. Can you help me with examples?

@zmughal
Copy link
Member Author

zmughal commented Dec 29, 2021

The only example I had at the time was to default to barf by default for sclr:

      PDL->sclr({Check => 'barf'}); # croak if called with multi-el pdls

I opened the issue in hopes of getting ideas for more places where extra checking could be done. I would be thinking an API based on Devel::StrictMode like MooX::Should.

@mohawk2
Copy link
Member

mohawk2 commented Dec 29, 2021

I'd have thought that sclr on a multi-elt pdl is simply an error, and should just barf anyway? Basically, I'm not seeing the benefit of non-strict mode; either these things are right, or they're not.

@zmughal
Copy link
Member Author

zmughal commented Dec 29, 2021

That's fair. I don't have any other examples yet. sclr is more about API correctness.

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

No branches or pull requests

2 participants