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

Jump Command #67

Closed
phase opened this issue Feb 17, 2016 · 10 comments
Closed

Jump Command #67

phase opened this issue Feb 17, 2016 · 10 comments

Comments

@phase
Copy link
Owner

phase commented Feb 17, 2016

Putting code in loops can get big, so why not have a jump command? I was thinking R would be good.

@refi64
Copy link
Collaborator

refi64 commented Feb 17, 2016

How exactly would this work?

@phase
Copy link
Owner Author

phase commented Feb 17, 2016

Pop a number off the stack and go to that position in the code. Or maybe two numbers because it's two dimensional source code.

@ghost
Copy link

ghost commented Feb 28, 2016

By position, do you mean character?

@refi64
Copy link
Collaborator

refi64 commented Feb 28, 2016

Side note: this is way more complicated than it seems, since you have to handle things like jumping into strings and arrays and code blocks (what happens when you do 4R"abcdefg"?).

@phase
Copy link
Owner Author

phase commented Feb 28, 2016

@Hipe99 Yes, the character with the position popped.

@kirbyfan64 I think that's a good "feature" to have. "1o1R"1R would push a string to the stack, then jump inside that string and print 1 over and over. Using parts of strings as code could be useful for compressing stuff.

@refi64
Copy link
Collaborator

refi64 commented Feb 28, 2016

@phase Very true. What did you mean by 2-dimensional? I thought O was 1-dimensional...

@phase
Copy link
Owner Author

phase commented Feb 28, 2016

The row and column in the source code.

  0123456789
0 1o
1 "hi"o

@ghost
Copy link

ghost commented Mar 5, 2016

eh, do newlines count for anything?

@phase phase self-assigned this May 1, 2016
@jamen
Copy link

jamen commented May 12, 2016

Essentially a goto operator? I also think the position should be done linearly not via line and column. A language in my experience rarely needs to use lines and columns internally besides for debugging, unless it is based around it somehow (which would be annoying in my opinion).

@phase
Copy link
Owner Author

phase commented Jul 8, 2016

I'm not to keen on the idea now. If we have to use manual jumps instead of the control flow operators that are built in, we're using the language wrong.

@phase phase closed this as completed Jul 8, 2016
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