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

Constant as a class name #155

Closed
x87 opened this issue Jun 17, 2021 · 2 comments
Closed

Constant as a class name #155

x87 opened this issue Jun 17, 2021 · 2 comments
Labels
out-of-scope This will not be worked on scope:compiler type:feature New feature or request

Comments

@x87
Copy link
Collaborator

x87 commented Jun 17, 2021

I have a small suggestion, don't know if that's possible to implement, but it would be nice. I noticed that you can't call class commands from a constant. For instance, if you declare 3@ as an Actor and assign a constant swt to the value 3@, then you can use

yet you won't be able use

swt.Create(…)

The latter, I think, may make constants even more helpful in SB (again, if possible and reasonable).

Originally posted by @VitalRus95 in #130 (comment)

@wmysterio
Copy link

Hmm, if such a record becomes available, is it possible to add the ability to specify the type in the const-end block?

const
swt = 3@ : Actor
end

swt.Create(…)

Then it turns out that the var-end block is not needed at all :)

var
3@ : Actor
end

const
swt = 3@
end

@x87
Copy link
Collaborator Author

x87 commented Jun 17, 2021

@wmysterio this idea was already expressed in #32 . In short I'm not a fan of doing that as it makes a difference between constants and variables very vague.
I'm in favor of the inline declaration as here: #37 (comment)

@x87 x87 added out-of-scope This will not be worked on and removed status:in dev triage labels Jul 28, 2021
@x87 x87 closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
out-of-scope This will not be worked on scope:compiler type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants