The string is a char[] null terminated array.what is the type of this string? what is its size?
I believe that is a preference.should free be called?
Code:clear value;
The string is a char[] null terminated array.what is the type of this string? what is its size?
I believe that is a preference.should free be called?
Code:clear value;
"without goto we would be wtf'd"
constructing formatted strings:
Code:<stdio.h>; <string.h>; @{ with char ; string1[100]; string2[100]; with float ; a = 1.0; b = 2.0; c = 3.0; total = 0; with; string1 = "a = %f, b = %f, c = %f", a, b, c; total = (a+b+c); string2 = "a+b+c = %f", total; ink [s]string1 "\n" [s]string2; };
"without goto we would be wtf'd"
Fibonacci Series:
Code:<stdio.h>; <string.h>; @{ int current = 0, next = 1, temp; ink "Enter the number of terms: "; get number; ink "Fibonacci Series: "; loop 1 to atoi(number) as i { ink [i]current; case i != atoi(number) { ink ", "; }; temp = ( current + next ); current = next; next = temp; }; };
"without goto we would be wtf'd"
Feel free to download and try hcc.exe
If you are wondering about a feature or have an idea on how to improve HyperC post your thoughts.
You can find it here:
Hyper C Compiler
"without goto we would be wtf'd"
That's an incomplete answer. Remember, if you're reading input to be stored in an array, the size of the array must be known in advance, whether it is a fixed size array or a variable length array. So, what's the size of the array? What if a larger array is required to fit all the input? What if the input is too large for the array? Can the size of the array be customised with get?Originally Posted by Structure
It isn't: calling free on an array of char results in undefined behaviour. As you're building on C, this means that you must either define the behaviour, or be explicit about retaining it.Originally Posted by Structure
This is a meaningless example. When giving examples, provide context and explain both syntax and semantics. You have this same issue in your documentation, which makes HyperC hard to understand. Ideally, provide both tutorial format documentation to guide potential users, and reference style documentation to properly document syntax and semantics.Originally Posted by Structure
By the way, you should take care about reserved words: are you really intending to make get and clear reserved words? They are so commonly used.
Last edited by laserlight; 09-14-2019 at 07:01 PM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Obviously, I am horrible at documentation.Ideally, provide both tutorial format documentation to guide potential users, and reference style documentation to properly document syntax and semantics.
It will be by the end of the day.Can the size of the array be customised with get?
tbh, i can do whatever i want. I built it.this means that you must either define the behaviour, or be explicit about retaining it.
"without goto we would be wtf'd"
Not saying that I'm volunteering, but one option then is to team up with someone who's better at documentation. This has the added benefit of being able to talk over stuff with someone else and hence improve your programming language.Originally Posted by Structure
Sure, but if nobody else knows how to use the constructs of your programming language because in your arrogance as language designer you keep things to yourself, then they simply aren't going to use your programming language. If you're interested in seeing adoption, then you have to define stuff and communicate it so potential users will understand the expected semantics.Originally Posted by Structure
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
It is now required that you set the size of the array.Can the size of the array be customised with get?
i.e:
before you would use get name.Code:<stdio.h>; <string.h>; @{ ink "Enter your name: "; get name[100]; ink "Hello " [s]name "."; };
now you define the size of the array: name[10];
Goals.improve your programming language.
Possibly...interested in seeing adoption
As far as the source goes, absolutely.keep things to yourself
bummer.they simply aren't going to use your programming language.
Last edited by Structure; 09-15-2019 at 08:48 AM.
"without goto we would be wtf'd"
That's what these posts are for.if nobody else knows how to use the constructs of your programming language
"without goto we would be wtf'd"
You can stop misquoting me now: I wrote that in reference to your reply to me that "tbh, i can do whatever i want. I built it." when I reminded you that "calling free on an array of char results in undefined behaviour" hence you "must either define the behaviour, or be explicit about retaining it", which is just common sense: if you don't say when undefined behaviour in C is defined in HyperC, who would know?
Furthermore, while it is alright to seek feedback for HyperC on this forum, you should be putting your actual HyperC documentation on its website, not here.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
oops?You can stop misquoting me now
tbh, I have no idea what this means.if you don't say when undefined behaviour in C is defined in HyperC
"without goto we would be wtf'd"
Do you understand what "undefined behaviour" means in C? It's important for HyperC since you want to build HyperC on C. If you were designing HyperC from scratch instead, you might choose to ditch the notion of undefined behaviour, which primarily has value for optimisation at the cost of potential bugs.Originally Posted by Structure
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I do not. I'm self taught and still learning.Do you understand what "undefined behaviour" means in C?
Last edited by Structure; 09-15-2019 at 02:14 PM.
"without goto we would be wtf'd"
The Wikipedia article is a good starting point: undefined behaviour
It's essential knowledge for a C programmer because it is such a source of bugs, and even more so if you're designing a language that builds on C, or if you're writing a compiler that uses C as its intermediate language.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
This is how i see it.It is the responsibility of the programmer to write code that never invokes undefined behavior.
Are you saying i should try not to allow undefined behaviour?
Last edited by Structure; 09-15-2019 at 02:21 PM.
"without goto we would be wtf'd"