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

Calling display() causes "Improper number of arguments for function Function join" #78

Open
KevOrr opened this issue Jul 24, 2020 · 0 comments · May be fixed by #79
Open

Calling display() causes "Improper number of arguments for function Function join" #78

KevOrr opened this issue Jul 24, 2020 · 0 comments · May be fixed by #79

Comments

@KevOrr
Copy link

KevOrr commented Jul 24, 2020

==display(1)

Runtime error in _system_library
On line 189 at position 20

display(x.) = \join(expand(map(i -> ; :str(i), x)))
                   ^
Improper number of arguments for function Function join @‌140628762953936-0
==display(1 2)

"1 2"
==display(1 2 3)

Runtime error in _system_library
On line 189 at position 20

display(x.) = \join(expand(map(i -> ; :str(i), x)))
                   ^
Improper number of arguments for function Function join @‌140628762953936-0

I believe this is because join is being called directly, instead of being folded. It looks like join in the past used to be variadic, before reduce was removed. Perhaps join could be changed to

_join(a b) = if (!a b 'a:_join(\a b)) # current definition of join()
join(xs.) = foldr(_join [] xs)

Then display would be able to call join variadically, as it is now

KevOrr added a commit to KevOrr/mathbot that referenced this issue Jul 24, 2020
@KevOrr KevOrr linked a pull request Jul 24, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant