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

Should we mimic Python operators and syntax? #15

Closed
VinGarcia opened this issue Apr 18, 2016 · 3 comments
Closed

Should we mimic Python operators and syntax? #15

VinGarcia opened this issue Apr 18, 2016 · 3 comments

Comments

@VinGarcia
Copy link
Member

Hello @bamos, with the multi-type support I am presenting on my pull request we will have the option to work with:

  • Boolean types
  • String operations

etc.

What if we try to mimic python operations and syntax.

Until now we were following C standarts, so true is the same as 1 and false the same as 0,
there were no boolean type, and no string operations.

Do you think it would be a good idea to borrow syntax from Python? I like it and it is usually easy for the user to understand what is happening.

This changes would imply in:

  1. power operator would be changed from ^ to **
  2. true reserved word would change to True, and the same for false
  3. We would have string concatenation with the operator +

And some other stuff.

What do you think? Is this a good a idea? May I proceed?

@bamos
Copy link
Member

bamos commented Jul 9, 2016

Hi @VinGarcia - sorry, I just realized I overlooked this from a few months ago. I think we've partially added this, like for string concatenation. I'd also be okay adding it for the other expressions. You can keep this issue open if you were planning on adding it and close it otherwise.

-Brandon.

@VinGarcia
Copy link
Member Author

I think I will make these changes with time.

It would be even better if we could think a way toggle the flavor of the syntax between the C, Python and others. I mean python-like syntax is just a personal preference. But I can't think of a good way to do that for now =/.

I will convert most things to a python style then.

@VinGarcia
Copy link
Member Author

VinGarcia commented Jul 21, 2016

I was thinking about this Issue, and I think that since this is a framework this kind of decision should be made by whoever uses the library. In future we should plan a way to make calculator extensible so that this kind of choice could be made by the user of the library.

For now I think we should 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

No branches or pull requests

2 participants