You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure how possible this is, as I'm not aware if your able to do this in java, but something that I think could be useful is the ability to pass a variable as the name for another variable. For example, in pseudo-code: string name = "intVariable"; int name.content = 10;
this would create an integer variable with the name intVariable
let me know what you think
The text was updated successfully, but these errors were encountered:
Very interesting idea especially for templating/macros. Remember we compile to the JVM not to Java code so anything is possible but it could require storing extra data. What would a use case of this be?
Well, It could be used to introduce some basic object oriented features. For example, say you've defined a struct Human,
this struct is something like this (in pseudocode): struct Human{ int xPos, int yPos, int ID }
and you're making a game where you're generating a village full of NPCs that use the Human Struct. You could define 20 different Human structs, or you could make a function that creates 20 different Human structs for you. Or, say you don't know how many NPCs are going to be in the village (it's determined by RNG, for example), you could make a function that generates a random amount of NPCs
I'm not sure how possible this is, as I'm not aware if your able to do this in java, but something that I think could be useful is the ability to pass a variable as the name for another variable. For example, in pseudo-code:
string name = "intVariable";
int name.content = 10;
this would create an integer variable with the name
intVariable
let me know what you think
The text was updated successfully, but these errors were encountered: