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

Variables as variable defaults don't work #283

Open
Alkali-Metal opened this issue Mar 30, 2017 · 8 comments
Open

Variables as variable defaults don't work #283

Alkali-Metal opened this issue Mar 30, 2017 · 8 comments
Assignees
Milestone

Comments

@Alkali-Metal
Copy link
Contributor

What is the issue?

When you put a variable as the default for another variable, it doesn't work, it returns the variable as it is.

How do we reproduce this issue?

image
Do that.

Environment

Remote hosted CactusBot 0.4

Other Information

I feel as though it should work because it would make default arguments much coolio-er. 😄

Also: default arguments for %ARGS% doesn't work, it returns Not enough arguments

@2Cubed
Copy link
Member

2Cubed commented Mar 30, 2017

Hmm... this wasn't really considered. Could look into it, just making sure that recursion isn't an issue. 👍

@Alkali-Metal
Copy link
Contributor Author

Yeah, that would be a mild issue. XD

@2Cubed 2Cubed changed the title [Possibly Intended] Arguments as Argument Defaults don't work Variables as variable defaults don't work Mar 30, 2017
@2Cubed 2Cubed added this to the v0.4.1 milestone Mar 30, 2017
@Innectic
Copy link
Member

Innectic commented May 6, 2017

Fixed this in #295

@Innectic Innectic closed this as completed May 6, 2017
@2Cubed
Copy link
Member

2Cubed commented May 6, 2017

Silly @Innectic. ;P

@2Cubed 2Cubed reopened this May 6, 2017
@Innectic
Copy link
Member

Innectic commented May 6, 2017

Can confirm, am noob.

@Alkali-Metal
Copy link
Contributor Author

You Innectato!

@2Cubed 2Cubed added the bug label May 23, 2017
@Alkali-Metal
Copy link
Contributor Author

So, I was thinking about this, and I would that only having one layer-o'-recursion would be fine, anything beyond that would just be pointless and redundant in my opinion.

One layer:   %ARGS=%NAME%%           #Would work
Two layers:  %ARGS=%ARG1=%NAME%%%    #Wouldn't work

If that makes any sense.

And it should check to see if they are the same so that it can't do something like %ARGS=%ARGS%%

@2Cubed
Copy link
Member

2Cubed commented May 29, 2017

I would agree; having more than one layer doesn't really make sense.

The more I think about it, the more I think recursion might not be an issue... for example, with the response %ARG1=%ARG2%% %ARG2=%ARG1%%:

  • If no args, error message.
  • If only %ARG1% as a, response is a a.
  • If also %ARG2% as b, response is a b.

@2Cubed 2Cubed modified the milestones: v0.4.1, v0.4.2 Jul 13, 2017
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

3 participants