-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support structs #30
Comments
OO is very hard to make in brainfuck. So I don't think that this is feasible yet. |
In this implementation there are no pointers (including function pointers), so making it OO is not feasible I'm afraid. |
The structs must have the size known. So when copying it to a variable or parameter, it would make enough space for the struct. Then when copying the struct, it copies every cell of the struct. The best way to start implementing structs is to make the function/variable compiler have a cell size value. So it can adjust the space between every variable's location on the tape. When accessing/writing a value from a struct it would point directly to that cell, since the name can't change. struct Example {
char message[5];
bool working;
};
struct Example test;
test.working = true; Would just write the value 1 to the 6th cell of the variable. |
Could you assign me to this? I want to try to implement this. |
What would you recommend to represent ID DOT ID (test.working) in the Node.py? |
I think it should be similar to NodeArrayGetElement and NodeArraySetElement We should also consider whether or not we allow arrays of structs. E.g. |
Arrays with structs is planned. I also came up with an idea that the pointer (*) could make it inherit the same id from that id map. So |
I might need to add more Node types such as |
Nevermind, it would probably be more messy to add new nodes |
It's your decision :) |
Ok i got arrays in structs working without adding any extra nodes. I also fixed a small bug that didn't do anything |
No description provided.
The text was updated successfully, but these errors were encountered: