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

"[ ... fcn (...) ...]" syntax problem in mycombvec, datetime, etc. #127

Open
Tracked by #137
apjanke opened this issue Feb 9, 2024 · 1 comment
Open
Tracked by #137
Assignees
Labels
bug Something isn't working chrono The date/time stuff
Milestone

Comments

@apjanke
Copy link
Owner

apjanke commented Feb 9, 2024

As reported by @mmuetzel in gnu-octave/packages#401 (my paraphrasing):


One of the doctests is failing:

      message = parse error near line 48 of file /usr/share/octave/packages/tablicious-0.4.2/+tblish/+internal/mycombvec.m
    syntax error
  >>>         out = [out; [repmat (a(i), [size (rest_combs,1) 1]) rest_combs]];
                                        ^
[...]

Spaces ( ) separate elements inside brackets ([ ]). So, that line is interpreted as out = [out; [repmat, (a(i), [size, (rest_combs,1), 1]), rest_combs]];. Combining comma-separated lists with parenthesis is not supported (and is probably not what you wanted).

That line should probably be the following instead:

out = [out; [repmat(a(i), [size(rest_combs,1), 1]), rest_combs]];

My notes:

Those extra spaces were a mistake. Probably introduced recently when I did this "Convert to GNU Octave code style" change, where I added a space at function calls to be "foo (...)" instead of "foo()", but didn't catch by manual inspection the places where that wasn't correct.

Probably introduced in v0.4.0.

This affected a few other functions, too. And in some cases, they were single-arg function calls, so no commas in the "(...)", which I think means they weren't syntax errors, but were incorrectly calling the function with zero args, and then concatenating its return value with the "(...)" expression that was supposed to be the function args, maybe raising a run-time error or just producing incorrect results. That's worse.

I've checked in a hopeful fix in 151d2ec and will be merging it soon and rolling a corrective patch release. Hopefully get some more unit test coverage in there too.

Recording this bug as its own ticket for reference, even though it's almost (I think) fixed.

@apjanke apjanke self-assigned this Feb 9, 2024
@apjanke apjanke added bug Something isn't working chrono The date/time stuff labels Feb 9, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in Octave-Tablicious Feb 9, 2024
@apjanke apjanke moved this from Needs triage to High priority in Octave-Tablicious Feb 9, 2024
@apjanke apjanke added this to the 0.4.3 milestone Feb 9, 2024
@apjanke apjanke modified the milestones: 0.4.3, 0.4.4 Jul 6, 2024
@apjanke
Copy link
Owner Author

apjanke commented Jul 6, 2024

Moved from milestone 0.4.3 to 0.4.4, because I want to push out 0.4.3 now to pick up #134.

@apjanke apjanke mentioned this issue Jul 7, 2024
5 tasks
@apjanke apjanke modified the milestones: 0.4.4, 0.5.0 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chrono The date/time stuff
Projects
Status: High priority
Development

No branches or pull requests

1 participant