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

new Minus #3246

Open
DanGrayson opened this issue May 18, 2024 · 3 comments
Open

new Minus #3246

DanGrayson opened this issue May 18, 2024 · 3 comments

Comments

@DanGrayson
Copy link
Member

i6 : new Minus from {a,b,c}

o6 = -a

o6 : Expression of class Minus

An error message should be issued here, because the initializing list has length greater than 1.

@d-torrance
Copy link
Member

Or should net(Minus) be updated to return -{a,b,c} instead?

@pzinn
Copy link
Contributor

pzinn commented May 19, 2024

No,net works correctly, a Minus is supposed to be of length 1.
That being said I don't understand the original issue. There are plenty of "illegal" objects one can create using the "new" construction. The latter is low level and therefore allows (and should allow) to construct essentially anything.
For a given class, one can always create a high level constructor (e.g., hashTable for HashTable) that can do all kinds of checks as needed.

@mahrud
Copy link
Member

mahrud commented May 19, 2024

i1 : new GradedModule from { blah => foo }

o1 = 0

o1 : GradedModule

i2 : peek oo

o2 = GradedModule{blah => foo}

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

4 participants