Skip to content

Variable types #2

Description

@brandonbothell

You should be able to have variable types, such as string, int, float, etc.

You should also be able to declare variables in this format:

int x = 5;

and set them in this format:

x = 6;

x = 'notanumber' should throw an error, because a string is not an int.
Redeclaring a variable should also throw an error.

int x = 5;
int x = 3; # Errors

Setting a variable that doesn't exist should also throw an error.
We also need a line terminator, like ;.
Having a line terminator also eliminates the need for the do function, which means we're going to need code blocks, preferably starting with { and ending with }.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions